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

Method cancelQueries

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

Source from the content-addressed store, hash-verified

274 }
275
276 cancelQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
277 filters?: QueryFilters<TTaggedQueryKey>,
278 cancelOptions: CancelOptions = {},
279 ): Promise<void> {
280 const defaultedCancelOptions = { revert: true, ...cancelOptions }
281
282 const promises = notifyManager.batch(() =>
283 this.#queryCache
284 .findAll(filters)
285 .map((query) => query.cancel(defaultedCancelOptions)),
286 )
287
288 return Promise.all(promises).then(noop).catch(noop)
289 }
290
291 invalidateQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
292 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