-
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Mar 13, 2022
Replies: 2 comments 1 reply
-
Ok, I guess I found the solution: export async function revalidateLiveQueries() {
const queryCache = queryClient.getQueryCache();
const liveQueriesOnScreen = queryCache.findAll({ active: true });
const queryKeys = liveQueriesOnScreen.map((query) => {
return query.queryKey;
});
await Promise.all(queryKeys.map((key) => queryClient.invalidateQueries(key)));
} Reading the documentation it is not clear to me how I should use Anyways, I managed to obtain the queries using the Thank you for the attention! |
Beta Was this translation helpful? Give feedback.
0 replies
-
if you want to revalidate all live queries, you can just do:
as you don't need a key to revalidate a query - any filter can do |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rfmiotto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you want to revalidate all live queries, you can just do:
as you don't need a key to revalidate a query - any filter can do