Skip to content

Commit

Permalink
Avoid invalidating cache watches when fetchPolicy is no-cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleyayers authored and benjamn committed Apr 8, 2019

Verified

This commit was signed with the committer’s verified signature.
benjamn Ben Newman
1 parent 5c0760b commit 6347887
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/apollo-client/src/core/QueryManager.ts
Original file line number Diff line number Diff line change
@@ -437,7 +437,9 @@ export class QueryManager<TStore> {
const requestId = this.generateRequestId();

// set up a watcher to listen to cache updates
const cancel = this.updateQueryWatch(queryId, query, updatedOptions);
const cancel = fetchPolicy !== 'no-cache'
? this.updateQueryWatch(queryId, query, updatedOptions)
: undefined;

// Initialize query in store with unique requestId
this.setQuery(queryId, () => ({

0 comments on commit 6347887

Please sign in to comment.