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

Method setMutationDefaults

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

Source from the content-addressed store, hash-verified

497 }
498
499 setMutationDefaults<
500 TData = unknown,
501 TError = DefaultError,
502 TVariables = void,
503 TOnMutateResult = unknown,
504 >(
505 mutationKey: MutationKey,
506 options: OmitKeyof<
507 MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,
508 'mutationKey'
509 >,
510 ): void {
511 this.#mutationDefaults.set(hashKey(mutationKey), {
512 mutationKey,
513 defaultOptions: options,
514 })
515 }
516
517 getMutationDefaults(
518 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