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

Method invalidateQueries

packages/query-core/src/queryClient.ts:298–318  ·  view source on GitHub ↗
(
    filters?: InvalidateQueryFilters<TTaggedQueryKey>,
    options: InvalidateOptions = {},
  )

Source from the content-addressed store, hash-verified

296 }
297
298 invalidateQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
299 filters?: InvalidateQueryFilters<TTaggedQueryKey>,
300 options: InvalidateOptions = {},
301 ): Promise<void> {
302 return notifyManager.batch(() => {
303 this.#queryCache.findAll(filters).forEach((query) => {
304 query.invalidate()
305 })
306
307 if (filters?.refetchType === 'none') {
308 return Promise.resolve()
309 }
310 return this.refetchQueries(
311 {
312 ...filters,
313 type: filters?.refetchType ?? filters?.type ?? 'active',
314 },
315 options,
316 )
317 })
318 }
319
320 refetchQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
321 filters?: RefetchQueryFilters<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
invalidateMethod · 0.80
findAllMethod · 0.45

Tested by

no test coverage detected