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

Method getMutationDefaults

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

Source from the content-addressed store, hash-verified

603 }
604
605 getMutationDefaults(
606 mutationKey: MutationKey,
607 ): OmitKeyof<MutationObserverOptions<any, any, any, any>, 'mutationKey'> {
608 const defaults = [...this.#mutationDefaults.values()]
609
610 const result: OmitKeyof<
611 MutationObserverOptions<any, any, any, any>,
612 'mutationKey'
613 > = {}
614
615 defaults.forEach((queryDefault) => {
616 if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
617 Object.assign(result, queryDefault.defaultOptions)
618 }
619 })
620
621 return result
622 }
623
624 defaultQueryOptions<
625 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