Stale data on variables change with no-cache fetch policy
See original GitHub issueBranching off from #6039 so the issue doesn’t get lost.
Intended outcome:
The data returned from useQuery
should be undefined when the variables change even when using fetchPolicy: 'no-cache'
.
Actual outcome:
The data remains stale regardless of #6566.
How to reproduce the issue:
I’ve tweaked the reproduction provided in #6039 - please click here.
Versions
I’m currently using v3.1.2 (see below) but the same issue happens in the latest 3.2.0-beta6.
System:
OS: Windows 10 10.0.19041
Binaries:
Node: 14.4.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files\nodejs\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 84.0.4147.135
Edge: Spartan (44.19041.423.0), Chromium (84.0.522.63)
npmPackages:
@apollo/client: 3.1.2 => 3.1.2
apollo-link-rest: 0.8.0-beta.0 => 0.8.0-beta.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Advanced topics on caching in Apollo Client
In this example, we use client. onResetStore to write default values to the cache. This is useful when using Apollo Client's local state...
Read more >Understanding Apollo Fetch Policies | by Galen Corey - Medium
Understanding fetch policies can be extremely helpful in thinking about data flow possibilities with the Apollo Client.
Read more >Query Cache - MariaDB Knowledge Base
Each time changes are made to the data in a table, all affected results in the query cache are cleared. It is not...
Read more >Advanced Topics on Caching – Angular
Using update gives you full control over the cache, allowing you to make changes to your data model in response to a mutation...
Read more >Caching in GitLab CI/CD
Runners use cache to speed up the execution of your jobs by reusing existing data. This can sometimes lead to inconsistent behavior. There...
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
Most (if not all?) of our stale data issues started waaaaaay back, when we decided to merge https://github.com/apollographql/react-apollo/pull/1639. This has been a monstrous source of problems over the years, and is an area we definitely need to get right as we work on our React integration layer rewrite.
Yes, it repros in
3.3.19
.Updated @delyanr 's repro with
3.3.19
and a working GraphQL endpoint here.