-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Refetching a no-cache query causes the response to be cached #6998
Comments
Same problem here. It's because https://github.com/apollographql/apollo-client/blob/main/src/core/QueryManager.ts#L848 |
xfournet
added a commit
to xfournet/apollo-client
that referenced
this issue
Sep 19, 2020
2 tasks
2 tasks
Resolve with #7761. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Intended outcome:
Refetching a query with a fetchPolicy of
no-cache
and notifyOnNetworkStatusChange enabled should not result in the response being cached.Actual outcome:
Refetching a query with fetchPolicy of
no-cache
and notifyOnNetworkStatusChange enabled causes the response to be cached.This occurs when using the refetch function provided by the Query component (or output of useQuery hook) and also when using refetchQueries on a mutation.
How to reproduce the issue:
Reproduction is here. Use the Apollo dev tools to inspect the cache before and after clicking the refetch button and observe that after the refetch, the query response is now cached.
https://github.com/lee-borsboom/react-apollo-error-template/tree/refetch_noCache_query
Versions
npx envinfo@latest --preset apollo --clipboard
isn't working for me, but I can replicate this on version 3.1.3 and 3.1.4 of Apollo clientThe text was updated successfully, but these errors were encountered: