You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
In the case above whenever I execute the refetchParent function I get a promise which resolves with the value from the data in the cache instead of the data from the re-run query.
My requirements force me to set the base query fetch policy as cache-and-network but I want to make sure when refetch function is executed I get data from the re-run query instead of data from the cache.
Any help on the issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Issues here are reserved for React Apollo bugs. You’ll have a much better chance of getting this answered in Apollo’s Spectrum community or on Stack Overflow. Thanks!
@anmolchandra96 I am in the exactly the same situation. We also have to use "cache-and-network" and we have an identical problem, so please let me know how you resolved it!
same here, I can see the refetch is being done, but there's no way I can do await refetch() because it resolves immediately with cache data. I need to be able to know when the actual network refetch has completed
Yes I don't necessarily want to remove "cache and network" in my original query. Being able to provide refetch options could be useful.
The refetch function when executed returns a promise which resolves with the data from the cache instead of data from the re-run query.
Example:
<Query query={SAMPLE_QUERY} fetchPolicy="cache-and-network"> { ({ refetch }) => <ChildComponent refetchParent={refetch} /> } </Query>
In the case above whenever I execute the refetchParent function I get a promise which resolves with the value from the data in the cache instead of the data from the re-run query.
My requirements force me to set the base query fetch policy as cache-and-network but I want to make sure when refetch function is executed I get data from the re-run query instead of data from the cache.
Any help on the issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: