T
TanStack•2y ago
correct-apricot

How to invalidate a query key for all opened pages?

I use queryClient.invalidateQueries(key) and it invalidates well for the current page window, but I would like it to invalidate all window pages currently open. How to do that?
3 Replies
exotic-emerald
exotic-emerald•2y ago
Do all windows share the same queryClient? Probably not. So make this work first 🙃
exotic-emerald
exotic-emerald•2y ago
broadcastQueryClient (Experimental) | TanStack Query Docs
VERY IMPORTANT: This utility is currently in an experimental stage. This means that breaking changes will happen in minor AND patch releases. Use at your own risk. If you choose to rely on this in production in an experimental stage, please lock your version to a patch-level version to avoid unexpected breakages. broadcastQueryClient is a utili...
correct-apricot
correct-apricotOP•2y ago
They do not. Thank you I'm gonna look into it

Did you find this page helpful?