fix issue with query cache

This commit is contained in:
Mathias Beaulieu-Duncan 2019-12-12 15:17:34 -06:00
parent ab99d5f076
commit db45cb5ad0
4 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@poweredsoft/ngx-data-apollo", "name": "@poweredsoft/ngx-data-apollo",
"version": "0.0.3", "version": "0.0.5",
"peerDependencies": { "peerDependencies": {
"@poweredsoft/data": "^0.0.26", "@poweredsoft/data": "^0.0.26",
"@angular/common": "^8.2.4", "@angular/common": "^8.2.4",

View File

@ -55,7 +55,8 @@ export class GraphQLDataSourceOptionsBuilder<TModel, TKey> {
query: this.createGraphQLQuery(query), query: this.createGraphQLQuery(query),
variables: { variables: {
criteria: advanceQuery criteria: advanceQuery
} },
fetchPolicy: 'no-cache'
}); });
return o$.pipe( return o$.pipe(

View File

@ -17,7 +17,7 @@ export class GenericRestDataSourceService
} }
private _handleErrorPipe(err: HttpErrorResponse) : Observable<IDataSourceError> { private _handleErrorPipe(err: HttpErrorResponse) : Observable<IDataSourceError> {
console.log(typeof(err.error), err); //console.log(typeof(err.error), err);
if (err.status == 500) { if (err.status == 500) {
return throwError(<IDataSourceErrorMessage>{ return throwError(<IDataSourceErrorMessage>{

View File

@ -55,16 +55,16 @@ export class AppComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.dataSource.notifyMessage$.subscribe((notification) => { this.dataSource.notifyMessage$.subscribe((notification) => {
console.log(notification); //console.log(notification);
}); });
this.dataSource.validationError$.subscribe((notification) => { this.dataSource.validationError$.subscribe((notification) => {
console.log(notification); //console.log(notification);
}); });
} }
onCreate(): void { onCreate(): void {
console.log('excuting command!'); //console.log('excuting command!');
this.dataSource.executeCommandByName('create', { this.dataSource.executeCommandByName('create', {
firstName: "", firstName: "",
lastName: "Baba" lastName: "Baba"
@ -76,7 +76,7 @@ export class AppComponent implements OnInit {
} }
onDelete(): void { onDelete(): void {
console.log('excuting command!'); //console.log('excuting command!');
this.dataSource.executeCommandByName('delete', { this.dataSource.executeCommandByName('delete', {
id: 1 id: 1
}).subscribe(() => { }).subscribe(() => {