約6,320件1ページ目

日本語のみで絞り込む

For that purpose, the QueryClient has an invalidateQueries method that lets you intelligently mark queries as stale and potentially refetch them too! tsx. // ...

The invalidateQueries method can be used to invalidate and refetch single or multiple queries in the cache based on their query keys or any other functionally ...

2023/11/13 -Hi tanstack query experts. Using the latest version of tanstack query, is there a way to invalidate multiple queries?

For a technique to automatically invalidate Queries after Mutations, have a look at TkDodo's article on Automatic Query Invalidation after Mutations. Edit on ...

2021/3/20 -I am trying to invalidate and refetch a query after performing a mutation on it by calling it in the method that the onSuccess option provides ...

2025/6/5 -If I understand correctly, invalidateQueries() only marks queries as stale. It triggers a refetch, but retry logic only applies when the ...

2024/5/25 -Here, we still use the predicate function to get a single call to queryClient.invalidateQueries . But inside of it, we do fuzzy matching with ...

Unlike QueryClient#invalidateQueries or QueryClient#refetchQueries, this removes matching queries from the cache instead of refetching them. Without filters, ...

After a mutation succeeds, you often know that related cached data is out of date. Use queryClient.invalidateQueries to mark matching queries stale and refetch ...

yes, you can await it to make sure the code after it only runs once the refetches that are potentially triggered by invalidation have completed.