* Sets default options for mutations whose mutation key partially matches the given * `mutationKey`. As with QueryClient#setQueryDefaults, the order of registration * matters when several registered defaults match the same mutation key. * * @see {@link QueryClient#getMutationDefa
(
mutationKey: MutationKey,
options: OmitKeyof<
MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>,
'mutationKey'
>,
)
| 921 | * ``` |
| 922 | */ |
| 923 | setMutationDefaults< |
| 924 | TData = unknown, |
| 925 | TError = DefaultError, |
| 926 | TVariables = void, |
| 927 | TOnMutateResult = unknown, |
| 928 | >( |
| 929 | mutationKey: MutationKey, |
| 930 | options: OmitKeyof< |
| 931 | MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>, |
| 932 | 'mutationKey' |
| 933 | >, |
| 934 | ): void { |
| 935 | this.#mutationDefaults.set(hashKey(mutationKey), { |
| 936 | mutationKey, |
| 937 | defaultOptions: options, |
| 938 | }) |
| 939 | } |
| 940 | |
| 941 | /** |
| 942 | * Returns the default options registered for mutations whose mutation key partially matches |
no test coverage detected