-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stale data on variables change with no-cache fetch policy #6905
Comments
Let us know if this is still a concern with |
@sdankel Can you try against 3.3.19? Sorry to hear you’re having trouble. |
Most (if not all?) of our stale data issues started waaaaaay back, when we decided to merge apollographql/react-apollo#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. |
Still reproducible with @apollo/[email protected] Maintaining a patch with ds300/patch-package is not a desirable option for us. It'd be extremely amazing if this issue was fixed here in the first place. Any chance fixing issue could be included into the road-map? TIA |
I have a similar issue when using |
#9135 seems related 👀 |
In case it's helpful to others: I was having this issue in 3.2.5, but upgrading to 3.5.6 fixed it. |
Oops, turns out it doesn't completely fix the problem. I get stale data for one render, then on the next render, Added: Same issue as #9135 (comment) |
I believe this is a misunderstanding of It does not mean that the hook itself will not preserve previous data if you change query variables. To my knowledge, we don't have a feature like that. You'd have to treat the result as |
Branching 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 usingfetchPolicy: '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.
The text was updated successfully, but these errors were encountered: