Open History to see the last commit
1---
2id: MutateOptions
3title: MutateOptions
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8Defined in: [packages/query-core/src/types.ts:2013](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L2013)
9β
10The callbacks that can be passed to `mutate` for a single call. They run after the callbacks of
11the mutation options.
12β
13## Type Parameters
14β
15### TData
16β
17`TData` = `unknown`
18β
19### TError
20β
21`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
22β
23### TVariables
24β
25`TVariables` = `void`
26β
27### TOnMutateResult
28β
29`TOnMutateResult` = `unknown`
30β
31## Properties
32β
33| Property | Type | Description |
34| ------ | ------ | ------ |
35| <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. |
36| <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. |
37| <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. |