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

Method getQueryDefaults

packages/query-core/src/queryClient.ts:481–497  ·  view source on GitHub ↗
(
    queryKey: QueryKey,
  )

Source from the content-addressed store, hash-verified

479 }
480
481 getQueryDefaults(
482 queryKey: QueryKey,
483 ): OmitKeyof<QueryObserverOptions<any, any, any, any, any>, 'queryKey'> {
484 const defaults = [...this.#queryDefaults.values()]
485
486 const result: OmitKeyof<
487 QueryObserverOptions<any, any, any, any, any>,
488 'queryKey'
489 > = {}
490
491 defaults.forEach((queryDefault) => {
492 if (partialMatchKey(queryKey, queryDefault.queryKey)) {
493 Object.assign(result, queryDefault.defaultOptions)
494 }
495 })
496 return result
497 }
498
499 setMutationDefaults<
500 TData = unknown,

Callers 10

defaultQueryOptionsMethod · 0.95
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
buildMethod · 0.45

Calls 1

partialMatchKeyFunction · 0.90

Tested by

no test coverage detected