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

Method setMutationDefaults

packages/query-core/src/queryClient.ts:587–603  ·  view source on GitHub ↗
(
    mutationKey: MutationKey,
    options: OmitKeyof<
      MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,
      'mutationKey'
    >,
  )

Source from the content-addressed store, hash-verified

585 }
586
587 setMutationDefaults<
588 TData = unknown,
589 TError = DefaultError,
590 TVariables = void,
591 TOnMutateResult = unknown,
592 >(
593 mutationKey: MutationKey,
594 options: OmitKeyof<
595 MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,
596 'mutationKey'
597 >,
598 ): void {
599 this.#mutationDefaults.set(hashKey(mutationKey), {
600 mutationKey,
601 defaultOptions: options,
602 })
603 }
604
605 getMutationDefaults(
606 mutationKey: MutationKey,

Callers 10

ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
mutations.test.tsxFile · 0.45
hydration.test.tsxFile · 0.45

Calls 1

hashKeyFunction · 0.90

Tested by

no test coverage detected