fetchPolicy="network-only" still returns data from the cache
See original GitHub issueIt seems like even when I’m using network-only that data from the cache is being returned immediately. I would have expected that the rendering phases would be:
{ data: {}, loading: true } // render 1
{ data: { foo: {…} }, loading: false } // render 2
// done
Instead what happens is that if data from the cache exists, at render 1 data will actually be populated with the cache data.
The React Apollo docs make it clear this should never happen:
network-only: This fetch policy will never return you initial data from the cache. Instead it will always make a request using your network interface to the server. This fetch policy optimizes for data consistency with the server, but at the cost of an instant response to the user when one is available.
For now I’m using a wrapper that returns {} when loading=true and fetchPolicy=no-cache or fetchPolicy=network-only.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
Who found a workaround for this?
I need a solution for this too.
fetchPolicy: "network-only"is not working.