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

Method getMutationDefaults

packages/query-core/src/queryClient.ts:517–534  ·  view source on GitHub ↗
(
    mutationKey: MutationKey,
  )

Source from the content-addressed store, hash-verified

515 }
516
517 getMutationDefaults(
518 mutationKey: MutationKey,
519 ): OmitKeyof<MutationObserverOptions<any, any, any, any>, 'mutationKey'> {
520 const defaults = [...this.#mutationDefaults.values()]
521
522 const result: OmitKeyof<
523 MutationObserverOptions<any, any, any, any>,
524 'mutationKey'
525 > = {}
526
527 defaults.forEach((queryDefault) => {
528 if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
529 Object.assign(result, queryDefault.defaultOptions)
530 }
531 })
532
533 return result
534 }
535
536 defaultQueryOptions<
537 TQueryFnData = unknown,

Callers 9

ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 1

partialMatchKeyFunction · 0.90

Tested by

no test coverage detected