Replies: 2 comments 9 replies
-
removeQueries is what you are looking for I believe. Can you show a reproduction of what is not working for you please |
Beta Was this translation helpful? Give feedback.
8 replies
-
I solved this issue with queryClient.clear(); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want that after the user logout of my application the react query removes its cache, however i was searching in the official docs i found the methods:

queryClient.removeQueries(key);
<-- Removes the queries ??queryClient.invalidateQueries(key);
<-- Invalidate all queries or a specefic query, but refetching it and saves it again in the cache:-/queryClient.clear();
<-- Remove the cache?, to me not work this.The methods not work for me :(
Then, is there some method that react query provides me to remove the cache without refetch them again?
it's a problem the cache because i need that when the user logout, the app remove all user old state and the cache too.
Beta Was this translation helpful? Give feedback.
All reactions