T
TanStack13mo ago
extended-salmon

How can I reset query cache without refetching it?

I’m trying to remove data from cache and not refetch it. I have tried reset and refetch queries. They don’t seem to work right.
6 Replies
extended-salmon
extended-salmonOP13mo ago
Can I get help here please?
other-emerald
other-emerald13mo ago
you are probably still subscribed to the query when you refetch it
extended-salmon
extended-salmonOP13mo ago
I’ve gone through the documentation several times and it seems there’s no way to just clear a particular cache Without performing refetch after
exotic-emerald
exotic-emerald13mo ago
Refetching only happens when you manually refetch, or there is a subscriber. A useQuery is probably subscribed as vossmalte mentioned
optimistic-gold
optimistic-gold13mo ago
queryClient.removeQueries ?
optimistic-gold
optimistic-gold13mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user

Did you find this page helpful?