Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve processing of options.nextFetchPolicy #8465

Merged
merged 11 commits into from
Jul 9, 2021
Merged
Prev Previous commit
Next Next commit
Avoid specifying options.nextFetchPolicy for refetch operations.
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
commit 1dcc2e8a1a32aed3e4fd7cb431bcc4633a9fe0df
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