-
as the titles says, the case is when
as a result I see some data about I would like to do fully reset of state when user logged out |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Apr 22, 2025
Replies: 1 comment 3 replies
-
You can invalidate all the relevant queries or even remove them, set a pending state: const queryCache = useQueryCache()
// by default only active queries are invalidated
queryCache.invalidateQueries({ active: null })
for (const entry of queryCache.getEntries()) {
queryCache.remove(entry) // or setEntryState(entry, { status: 'pending', data: undefined, error: null })
} You can pass more filters to both invalidateQueries and getEntries to only affect authenticated queries. You could even include that in the key and use |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
tednaaa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can invalidate all the relevant queries or even remove them, set a pending state:
You can pass more filters to both invalidateQueries and getEntries to only affect authenticated queries. You could even include that in the key and use
predicate
function