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

Method setMutationDefaults

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

Source from the content-addressed store, hash-verified

509 }
510
511 setMutationDefaults<
512 TData = unknown,
513 TError = DefaultError,
514 TVariables = void,
515 TOnMutateResult = unknown,
516 >(
517 mutationKey: MutationKey,
518 options: OmitKeyof<
519 MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,
520 'mutationKey'
521 >,
522 ): void {
523 this.#mutationDefaults.set(hashKey(mutationKey), {
524 mutationKey,
525 defaultOptions: options,
526 })
527 }
528
529 getMutationDefaults(
530 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