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

Method getMutationDefaults

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

Source from the content-addressed store, hash-verified

527 }
528
529 getMutationDefaults(
530 mutationKey: MutationKey,
531 ): OmitKeyof<MutationObserverOptions<any, any, any, any>, 'mutationKey'> {
532 const defaults = [...this.#mutationDefaults.values()]
533
534 const result: OmitKeyof<
535 MutationObserverOptions<any, any, any, any>,
536 'mutationKey'
537 > = {}
538
539 defaults.forEach((queryDefault) => {
540 if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
541 Object.assign(result, queryDefault.defaultOptions)
542 }
543 })
544
545 return result
546 }
547
548 defaultQueryOptions<
549 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