-
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
fetchPolicy: 'cache-and-network' and @client not fetching from the cache #3177
Comments
I have a same problem. QueryManager.ts line 360
In function markQueryResultClient with fetch policy 'cache-and-network' second argument always pass 'false' and it fetch from remote storage instead of fetch from cache. When I replace '!shouldFetch' on 'true' everything became good. |
Idk, if this is actually a bug. I was printing out the results of the query and I found that on the second watch it returns the result from the cache but also returns loading true. The problem is if loading should be true in this case or is it better for loading to be false or to have a new value loaded for something like that. |
@asafigan I also see this behaviour - the data is returned from the query but
|
Thanks for reporting this. There hasn't been any activity here in quite some time, so we'll close this issue for now. If this is still a problem (using a modern version of Apollo Client), please let us know. Thanks! |
I’m checking that when setting the following default options on ApolloClient:
a query marked with
@client
is not returning the info from the cache unless a resolver to the query is implemented or marked with the following optionsoptions: { fetchPolicy: 'cache-only' }
.I exposed this on slack channel and I got the following response from Dennis Bækgaard, maybe it can help:
Version
The text was updated successfully, but these errors were encountered: