MCPcopy
hub / github.com/TanStack/query / getQueryDefaults

Method getQueryDefaults

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

Source from the content-addressed store, hash-verified

491 }
492
493 getQueryDefaults(
494 queryKey: QueryKey,
495 ): OmitKeyof<QueryObserverOptions<any, any, any, any, any>, 'queryKey'> {
496 const defaults = [...this.#queryDefaults.values()]
497
498 const result: OmitKeyof<
499 QueryObserverOptions<any, any, any, any, any>,
500 'queryKey'
501 > = {}
502
503 defaults.forEach((queryDefault) => {
504 if (partialMatchKey(queryKey, queryDefault.queryKey)) {
505 Object.assign(result, queryDefault.defaultOptions)
506 }
507 })
508 return result
509 }
510
511 setMutationDefaults<
512 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