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

Method resetQueries

packages/query-core/src/queryClient.ts:261–281  ·  view source on GitHub ↗
(
    filters?: QueryFilters<TTaggedQueryKey>,
    options?: ResetOptions,
  )

Source from the content-addressed store, hash-verified

259 }
260
261 resetQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
262 filters?: QueryFilters<TTaggedQueryKey>,
263 options?: ResetOptions,
264 ): Promise<void> {
265 const queryCache = this.#queryCache
266
267 return notifyManager.batch(() => {
268 const matched = queryCache.findAll(filters)
269 const queriesToRefetch = new Set(matched)
270 matched.forEach((query) => {
271 query.reset()
272 })
273 return this.refetchQueries(
274 {
275 type: 'active',
276 predicate: (query) => queriesToRefetch.has(query),
277 },
278 options,
279 )
280 })
281 }
282
283 cancelQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
284 filters?: QueryFilters<TTaggedQueryKey>,

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

Calls 3

refetchQueriesMethod · 0.95
findAllMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected