Skip to content

How should one clear a persisted Query Client? #3782

Answered by gillkyle
gillkyle asked this question in Q&A
Discussion options

You must be logged in to vote

Okay I found the answer and I feel silly that it took writing out all of this and going through so many attempts to get it right, but have learned a lot about the inner workings in the process!

Turns out since the cache comes from the queryClient that is in memory, my last idea listed in my original post is actually correct, I can simply wipe the client and let it write the new empty store to the persisted cache like so:

queryClient.clear()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lili21
Comment options

@TkDodo
Comment options

Answer selected by gillkyle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants