Open History to see the last commit
1---
2id: MutationState
3title: MutationState
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8Defined in: [packages/query-core/src/mutation.ts:30](https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L30)
9β
10The raw state stored on a `Mutation` instance. This is the underlying state
11that observer results (e.g. `MutationObserverResult`) are derived from.
12β
13## Extended by
14β
15- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)
16β
17## Type Parameters
18β
19### TData
20β
21`TData` = `unknown`
22β
23### TError
24β
25`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
26β
27### TVariables
28β
29`TVariables` = `unknown`
30β
31### TOnMutateResult
32β
33`TOnMutateResult` = `unknown`
34β
35## Properties
36β
37| Property | Type | Description |
38| ------ | ------ | ------ |
39| <a id="property-context"></a> `context` | `TOnMutateResult` \| `undefined` | The value returned by `onMutate`, if defined. Passed to `onSuccess`, `onError` and `onSettled` as the mutation's context. |
40| <a id="property-data"></a> `data` | `TData` \| `undefined` | The last successfully resolved data for the mutation. |
41| <a id="property-error"></a> `error` | `TError` \| `null` | The error object for the mutation, if the last attempt resulted in an error. - Defaults to `null`. |
42| <a id="property-failurecount"></a> `failureCount` | `number` | The number of times the mutation function has failed for the current attempt. |
43| <a id="property-failurereason"></a> `failureReason` | `TError` \| `null` | The reason the current attempt failed, as reported by the retryer. |
44| <a id="property-ispaused"></a> `isPaused` | `boolean` | Whether the mutation is currently paused (see network mode), or is waiting for another mutation with the same `scope` to finish. |
45| <a id="property-status"></a> `status` | `"error"` \| `"idle"` \| `"pending"` \| `"success"` | The status of the mutation. |
46| <a id="property-submittedat"></a> `submittedAt` | `number` | The timestamp for when the mutation was submitted. |
47| <a id="property-variables"></a> `variables` | `TVariables` \| `undefined` | The variables the mutation was last called with. |