Skip to content

Commit

Permalink
Avoid specifying options.nextFetchPolicy for refetch operations.
Browse files Browse the repository at this point in the history
Specifying options.nextFetchPolicy is unnecessary because refetch
operations receive a (disposable) copy of the ObservableQuery options,
so options.fetchPolicy does not need to be reset.
  • Loading branch information
benjamn committed Jul 9, 2021
1 parent 1ab0161 commit 1dcc2e8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/core/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ export class ObservableQuery<
reobserveOptions.fetchPolicy = 'no-cache';
} else if (fetchPolicy !== 'cache-and-network') {
reobserveOptions.fetchPolicy = 'network-only';
// Go back to the original options.fetchPolicy after this refetch.
reobserveOptions.nextFetchPolicy = fetchPolicy || "cache-first";
}

if (variables && !equal(this.options.variables, variables)) {
Expand Down

0 comments on commit 1dcc2e8

Please sign in to comment.