-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
It's not possible to reset store without query refetching #53
Comments
related to apollographql/apollo-client#1509 |
I got the same problem. |
Looks like react-apollo had the same issue, until this PR apollographql/react-apollo#531 There was this PR apollographql/apollo-client#1636 that introduced a new fetch policy "standby" for this kind of use case |
you can try this: |
For others with multiple clients, you can run this from inside a component:
|
@Risbot sharing your solution across related issues. thanks! |
does apollo: {
profile: GetProfile
} <div v-if="profile">
// user data
</div> When I call On logout I would like to clear cache and store data (without re-running queries) and get the view updated as it happen after a mutation for example. What is the proper way to do it? Thanks in advance |
Just found my way here & want to make sure you got your answer, @b4dnewz. You still need help with clearing your store? |
@bswank actually with the latest version it does not happen, or at least I've not experienced it anymore |
@Akryum This ticket shouldn't be closed. Smart queries still ignore the skip function/flag when data is refetched |
I am using following middleware to handle authorization:
In my component (for authenticated users) I use following query:
When user logs out, I clear accessToken, call
apollo.resetStore()
and redirect to/login
page.The problem is that after calling
apollo.resetStore()
apollo automatically refetches projectList query, however it receives 401 error since accessToken had been cleared. I tried to use$skipAll
option like this:But it is not called at all when apollo automatically refetches queries after
apollo.resetStore()
. Is there any other way to clearStore without refetching queries?The text was updated successfully, but these errors were encountered: