apollo-client not working as expected for `network-only` cache policy, duplicate requests noticed
See original GitHub issueIntended outcome: Network tab doesn’t show duplicate query requests
Actual outcome:
Noticed the query being requested for twice How to reproduce the issue:
Versions System: OS: macOS High Sierra 10.13.6 Binaries: Node: 12.9.1 - /usr/local/bin/node npm: 6.10.3 - /usr/local/bin/npm Browsers: Chrome: 84.0.4143.2 Firefox: 75.0 Safari: 13.1 npmGlobalPackages: apollo: 3.0.0-beta.45
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:23 (7 by maintainers)
Top Results From Across the Web
Setting The Correct Fetch Policy - Help - Apollo Community
I've noticed for example that upon requesting page 2 of live data, it this errors, I see page 1!! Just now I tried...
Read more >Advanced topics on caching in Apollo Client
This article describes special cases and considerations when using the Apollo Client cache. Bypassing the cache. Sometimes you shouldn't use the cache for...
Read more >Fetching data with queries | Full-Stack Quickstart
A fetch policy defines how Apollo Client uses the cache for a particular query. The default policy is cache-first , which means Apollo...
Read more >Local state management - Apollo GraphQL Docs
Learn how to work with your local data in Apollo Client. ... Direct writes to the cache do not require a GraphQL mutation...
Read more >Refetching queries in Apollo Client - Apollo GraphQL Docs
The InMemoryCache helps you determine which active queries might have been invalidated by recent cache updates. Local cache updates and refetching work ......
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 Free
Top 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
minimal reproduction here: codesandbox
Intended outcome: 1 request to
/api/graphql
when clicking theFetch More
buttonActual outcome: 2 requests to
/api/graphql
How to reproduce the issue: click
Fetch More
& observe in devtools network tabrunning into the same issue as @kfazinic — cache-first is the only option that will render the correct data.
network-only
andcache-and-network
both first two requests… the first one has the correctoffset
, and the second is a stale offset. on apollo-clientv3.3.9