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

Method invalidateQueries

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

Source from the content-addressed store, hash-verified

289 }
290
291 invalidateQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
292 filters?: InvalidateQueryFilters<TTaggedQueryKey>,
293 options: InvalidateOptions = {},
294 ): Promise<void> {
295 return notifyManager.batch(() => {
296 this.#queryCache.findAll(filters).forEach((query) => {
297 query.invalidate()
298 })
299
300 if (filters?.refetchType === 'none') {
301 return Promise.resolve()
302 }
303 return this.refetchQueries(
304 {
305 ...filters,
306 type: filters?.refetchType ?? filters?.type ?? 'active',
307 },
308 options,
309 )
310 })
311 }
312
313 refetchQueries<TTaggedQueryKey extends QueryKey = QueryKey>(
314 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