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

Method getQueryDefaults

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

Source from the content-addressed store, hash-verified

567 }
568
569 getQueryDefaults(
570 queryKey: QueryKey,
571 ): OmitKeyof<QueryObserverOptions<any, any, any, any, any>, 'queryKey'> {
572 const defaults = [...this.#queryDefaults.values()]
573
574 const result: OmitKeyof<
575 QueryObserverOptions<any, any, any, any, any>,
576 'queryKey'
577 > = {}
578
579 defaults.forEach((queryDefault) => {
580 if (partialMatchKey(queryKey, queryDefault.queryKey)) {
581 Object.assign(result, queryDefault.defaultOptions)
582 }
583 })
584 return result
585 }
586
587 setMutationDefaults<
588 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