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

Method cancelQueries

packages/query-core/src/queryClient.ts:283–296  ·  view source on GitHub ↗
(
    filters?: QueryFilters<TTaggedQueryKey>,
    cancelOptions: CancelOptions = {},
  )

Source from the content-addressed store, hash-verified

281 }
282
283 cancelQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
284 filters?: QueryFilters<TTaggedQueryKey>,
285 cancelOptions: CancelOptions = {},
286 ): Promise<void> {
287 const defaultedCancelOptions = { revert: true, ...cancelOptions }
288
289 const promises = notifyManager.batch(() =>
290 this.#queryCache
291 .findAll(filters)
292 .map((query) => query.cancel(defaultedCancelOptions)),
293 )
294
295 return Promise.all(promises).then(noop).catch(noop)
296 }
297
298 invalidateQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
299 filters?: InvalidateQueryFilters<TTaggedQueryKey>,

Callers 15

WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
WithKnownParametersFunction · 0.45
WithIdentifiersFunction · 0.45
ExampleWithUnknownKeyFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 2

cancelMethod · 0.80
findAllMethod · 0.45

Tested by

no test coverage detected