Skip to content

Commit 92435c7

Browse files
authored
fix(types): add mutationFn to UseMutationOptions (TanStack#2182)
1 parent 07ce2a5 commit 92435c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/react/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
QueryObserverOptions,
99
QueryObserverResult,
1010
QueryKey,
11+
MutationFunction,
1112
} from '../core/types'
1213

1314
export interface UseBaseQueryOptions<
@@ -75,8 +76,11 @@ export interface UseMutationOptions<
7576
TVariables = void,
7677
TContext = unknown
7778
> {
79+
mutationFn?: MutationFunction<TData, TVariables>
7880
mutationKey?: MutationKey
79-
onMutate?: (variables: TVariables) => Promise<TContext> | Promise<undefined> | TContext | undefined
81+
onMutate?: (
82+
variables: TVariables
83+
) => Promise<TContext> | Promise<undefined> | TContext | undefined
8084
onSuccess?: (
8185
data: TData,
8286
variables: TVariables,

0 commit comments

Comments
 (0)