-
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
Skipped Query returns outdated data after cache clearing #11804
Comments
If your hook was mounted all that time, that is possible. Generally, cache updates are forwarded to the hooks, but skipping a hook also means skipping any updates from the cache - including a cache reset. If the component with that hook would be unmounted and remounted, it would start with a blank state, but since it seems to stay mounted in your case, the moment you "un-skip", it will pick back up with the last state it had and wait for future cache updates. |
@phryneas Thank you very much! I spent 3 days searching for this information. |
I think remounting is the safest bet you have - just put a |
Thank you! I'll try this variant |
I think I can close this issue then - but please feel free to open a new issue in the future :) |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have query to get user data (roles, username)
Also I have storeClearing on logout
After cache clearing on auth page we call getUserData hook. As token is empty I expected, what query will skipped and data would be undefined. But it still returns old data, cache is clear though. It is make bug: when I logout, changing userData on database and login again - then I have outdated data.
Any help please, I blew my mind 🤯
The text was updated successfully, but these errors were encountered: