MCPcopy Create free account
hub / github.com/TanStack/query / removeQueries

Method removeQueries

packages/query-core/src/queryClient.ts:402–411  ·  view source on GitHub ↗

* Removes queries from the cache that match the given filters. Unlike * QueryClient#invalidateQueries or QueryClient#refetchQueries, this removes * matching queries from the cache instead of refetching them. Without filters, every query in * the cache is removed. * @param

(
    filters?: QueryFilters<TTaggedQueryKey>,
  )

Source from the content-addressed store, hash-verified

400 * ```
401 */
402 removeQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
403 filters?: QueryFilters<TTaggedQueryKey>,
404 ): void {
405 const queryCache = this.#queryCache
406 notifyManager.batch(() => {
407 queryCache.findAll(filters).forEach((query) => {
408 queryCache.remove(query)
409 })
410 })
411 }
412
413 /**
414 * Resets queries matching the given filters back to their initial state (e.g. any

Callers 15

WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
QueryDetailsFunction · 0.45
Devtools.test.tsxFile · 0.45

Calls 2

findAllMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected