Skip to content

Commit

Permalink
Merge branch 'main' into feature/ts-5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
TkDodo authored Mar 3, 2025
2 parents 64a8e0b + 4d8c27b commit 16cddcb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/query-core/src/queryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,14 +605,17 @@ export class QueryClient {

getMutationDefaults(
mutationKey: MutationKey,
): MutationObserverOptions<any, any, any, any> {
): OmitKeyof<MutationObserverOptions<any, any, any, any>, 'mutationKey'> {
const defaults = [...this.#mutationDefaults.values()]

let result: MutationObserverOptions<any, any, any, any> = {}
const result: OmitKeyof<
MutationObserverOptions<any, any, any, any>,
'mutationKey'
> = {}

defaults.forEach((queryDefault) => {
if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
result = { ...result, ...queryDefault.defaultOptions }
Object.assign(result, queryDefault.defaultOptions)
}
})

Expand Down

0 comments on commit 16cddcb

Please sign in to comment.