Open History to see the last commit
1---
2id: MutateOptions
3title: MutateOptions
4---
5β
6Defined in: [packages/query-core/src/types.ts:2012](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L2012)
7β
8The callbacks that can be passed to `mutate` for a single call. They run after the callbacks of
9the mutation options.
10β
11## Type Parameters
12β
13### TData
14β
15`TData` = `unknown`
16β
17### TError
18β
19`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
20β
21### TVariables
22β
23`TVariables` = `void`
24β
25### TOnMutateResult
26β
27`TOnMutateResult` = `unknown`
28β
29## Properties
30β
31| Property | Type | Description |
32| ------ | ------ | ------ |
33| <a id="property-onerror"></a> `onError?` | (`error`: `TError`, `variables`: `TVariables`, `onMutateResult`: `TOnMutateResult` \| `undefined`, `context`: [`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md)) => `void` | Called when the mutation of this call fails, after the `onError` of the mutation options. |
34| <a id="property-onsettled"></a> `onSettled?` | (`data`: `TData` \| `undefined`, `error`: `TError` \| `null`, `variables`: `TVariables`, `onMutateResult`: `TOnMutateResult` \| `undefined`, `context`: [`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md)) => `void` | Called when the mutation of this call succeeds or fails, after the `onSettled` of the mutation options. |
35| <a id="property-onsuccess"></a> `onSuccess?` | (`data`: `TData`, `variables`: `TVariables`, `onMutateResult`: `TOnMutateResult` \| `undefined`, `context`: [`MutationFunctionContext`](../type-aliases/MutationFunctionContext.md)) => `void` | Called when the mutation of this call succeeds, after the `onSuccess` of the mutation options. |