-
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
resetStore causes queries with notifyOnNetworkStatusChange to return undefined #7138
Comments
I am having a hard time with the same issue. |
Adding some info from my specific case, it seems like for the issue to happen, besides having notifyOnNetworkStatusChange = true, you also need the query before and after reset store to return the same value. If I reset store adding an authentication and get a different result, it works correctly even with notifyOnNetworkStatusChange as true. |
Looking back through the version history for v3, it looks like it broke between 3.0.0-rc.4 and 3.0.0-rc5. And combined with @lucas-calzolari-toptal 's observation above it looks like this is probably the culprit: 0962d25 |
This should be fixed in |
Intended outcome:
Calling
client.resetStore
should properly update all watched queries, even if they havenotifyOnNetworkStatusChange: true
Actual outcome:
result.data
is undefined for queries that setnotifyOnNetworkStatusChange: true
after callingclient.resetStore
How to reproduce the issue:
resetStore()
buttonuseQuery
result.data
is undefined.notifyOnNetworkStatusChange: false
, and notice the query updates as expected.Versions
@apollo/client - 3.2.2
graphql - 14.7.0
Also tried with
3.3.0-beta.10
- same issue.The text was updated successfully, but these errors were encountered: