* Returns the default options registered for mutations whose mutation key partially matches * the given `mutationKey`, via QueryClient#setMutationDefaults. If multiple registered * defaults match, they are merged together in registration order. * @param mutationKey - The mutation ke
(
mutationKey: MutationKey,
)
| 1029 | * ``` |
| 1030 | */ |
| 1031 | getMutationDefaults( |
| 1032 | mutationKey: MutationKey, |
| 1033 | ): OmitKeyof<MutationObserverOptions<any, any, any, any>, 'mutationKey'> { |
| 1034 | const defaults = [...this.#mutationDefaults.values()] |
| 1035 | |
| 1036 | const result: OmitKeyof< |
| 1037 | MutationObserverOptions<any, any, any, any>, |
| 1038 | 'mutationKey' |
| 1039 | > = {} |
| 1040 | |
| 1041 | defaults.forEach((queryDefault) => { |
| 1042 | if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { |
| 1043 | Object.assign(result, queryDefault.defaultOptions) |
| 1044 | } |
| 1045 | }) |
| 1046 | |
| 1047 | return result |
| 1048 | } |
| 1049 | |
| 1050 | /** |
| 1051 | * Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the |
no test coverage detected