No difference beetween `cache-and-network` and `network-only` strategies!
See original GitHub issueI think the cache-and-network
strategy doesn’t work properly and acts similar to network-only
.
What To Expect
- apollo sends two queries to cache and network in parallel.
- if doesn’t exist in cache waiting for network and store in cache for next query.
- if exists, render data and wait for network in background for syncing data.
but in step 3 :
apollo doesn’t render cache data Immediately until network data is received. This is not fast and behaves like network-only
strategy.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:14
- Comments:6
Top Results From Across the Web
Understanding Apollo Fetch Policies | by Galen Corey - Medium
The 'no-cache' policy is similar to 'network-only', but it skips the step of updating the cache. This might be appropriate if you don't...
Read more >Queries - Apollo GraphQL Docs
If all data is available locally, useQuery returns that data and doesn't query your GraphQL server. This cache-first policy is Apollo Client's default...
Read more >React Apollo: Understanding Fetch Policy with useQuery
There are six fetch policies that are available on useQuery . ... no-cache, Similar to network-only, except the query's result is not stored...
Read more >reactjs - What is the difference between 'store-and-network' vs ...
With this distinction, the "network-only" fetch-policy will literally ignore the cache. It will not check whether the data the component ...
Read more >Basics of Caching Data in GraphQL Apollo React Client
no-cache policy does not read, nor does it write to the cache with the response. It will always make a request using your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just saw that if you use
notifyOnNetworkStatusChange: true
it works for me and does return the cached data on the first returnThis is the solution we are using to expose a
refetching
prop so we can control rendering behaviour better @wminshew @foad-salawatiThen you can do
I know it’s not a real solution to the issue, but maybe it helps as a patch