-
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
As of 3.5.0 a mutation's onCompleted that references data from a query that is updated has stale references #9493
Comments
This seems similar to #9111 but might not be exactly the same. |
could this be realted to #9333? |
No I don't believe it's related. That issue seems to be that the data coming from the query is delayed? Vs in my case the query data is as it should be but whenever you access that data specifically inside a mutation's In the reproduction it's clear that the query is operating properly :). I'll circle back to this and post the output of the reproduction and that should illustrate things. |
Just circling back to say that I've tested this against the latest 3.6.0-rc.1 and it has not been solved. @benjamn any chance that this can be looked at? We haven't been able to upgrade since |
Intended outcome:
Whenever a mutation's
onCompleted
referencesdata
from a query, thatonCompleted
has staledata
references in the case where the mutation causes the query to update.Actual outcome:
Whenever the mutation's
onCompleted
is invoked, it has the updated reference to the query's data property.How to reproduce the issue:
I've created a super simple reproduction here with a test case, just run:
npm install
npm test
I've also included a branch where the only difference is that
@apollo/client
version3.4.17
is used and the same spec passes properly.NOTE: I didn't see the template until my reproduction was created, my reproduction is super simple and contains a test to demonstrate when it's working properly. Hopefully that's ok.
Versions
Working Versions
The text was updated successfully, but these errors were encountered: