MCPcopy Create free account
hub / github.com/SvelteStack/svelte-query / setMutationDefaults

Method setMutationDefaults

src/queryCore/core/queryClient.ts:558–570  ·  view source on GitHub ↗
(
    mutationKey: MutationKey,
    options: MutationObserverOptions<any, any, any, any>
  )

Source from the content-addressed store, hash-verified

556 }
557
558 setMutationDefaults(
559 mutationKey: MutationKey,
560 options: MutationObserverOptions<any, any, any, any>
561 ): void {
562 const result = this.mutationDefaults.find(
563 x => hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey)
564 )
565 if (result) {
566 result.defaultOptions = options
567 } else {
568 this.mutationDefaults.push({ mutationKey, defaultOptions: options })
569 }
570 }
571
572 getMutationDefaults(
573 mutationKey?: MutationKey

Callers

nothing calls this directly

Calls 2

hashQueryKeyFunction · 0.90
findMethod · 0.45

Tested by

no test coverage detected