Open History to see the last commit
1---
2id: MutationObserverSuccessResult
3title: MutationObserverSuccessResult
4---
5β
6Defined in: [packages/query-core/src/types.ts:2297](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L2297)
7β
8A mutation result in the `success` state after the mutation succeeded.
9β
10## Extends
11β
12- [`MutationObserverBaseResult`](MutationObserverBaseResult.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\>
13β
14## Type Parameters
15β
16### TData
17β
18`TData` = `unknown`
19β
20### TError
21β
22`TError` = [`DefaultError`](../type-aliases/DefaultError.md)
23β
24### TVariables
25β
26`TVariables` = `void`
27β
28### TOnMutateResult
29β
30`TOnMutateResult` = `unknown`
31β
32## Properties
33β
34| Property | Type | Description | Overrides |
35| ------ | ------ | ------ | ------ |
36| <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. | - |
37| <a id="property-data"></a> `data` | `TData` | The data the mutation resolved with. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`data`](MutationObserverBaseResult.md#property-data) |
38| <a id="property-error"></a> `error` | `null` | `null`, since the mutation hasn't failed. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`error`](MutationObserverBaseResult.md#property-error) |
39| <a id="property-failurecount"></a> `failureCount` | `number` | The number of times the mutation function has failed for the current attempt. | - |
40| <a id="property-failurereason"></a> `failureReason` | `TError` \| `null` | The reason the current attempt failed, as reported by the retryer. | - |
41| <a id="property-iserror"></a> `isError` | `false` | `false`, since the mutation hasn't failed. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isError`](MutationObserverBaseResult.md#property-iserror) |
42| <a id="property-isidle"></a> `isIdle` | `false` | `false`, since the mutation has run. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isIdle`](MutationObserverBaseResult.md#property-isidle) |
43| <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. | - |
44| <a id="property-ispending"></a> `isPending` | `false` | `false`, since the mutation isn't running. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isPending`](MutationObserverBaseResult.md#property-ispending) |
45| <a id="property-issuccess"></a> `isSuccess` | `true` | `true`, since the mutation succeeded. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`isSuccess`](MutationObserverBaseResult.md#property-issuccess) |
46| <a id="property-mutate"></a> `mutate` | [`MutateFunction`](../type-aliases/MutateFunction.md)\<`TData`, `TError`, `TVariables`, `TOnMutateResult`\> | The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options. **Param** **variables** The variables object to pass to the `mutationFn`. **Param** **options.onSuccess** This function will fire when the mutation is successful and will be passed the mutation's result. **Param** **options.onError** This function will fire if the mutation encounters an error and will be passed the error. **Param** **options.onSettled** This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error. **Remarks** - If you make multiple requests, `onSuccess` will fire only after the latest call you've made. - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored. | - |
47| <a id="property-reset"></a> `reset` | () => `void` | A function to clean the mutation internal state (i.e., it resets the mutation to its initial state). | - |
48| <a id="property-status"></a> `status` | `"success"` | `'success'`, since the mutation succeeded. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`status`](MutationObserverBaseResult.md#property-status) |
49| <a id="property-submittedat"></a> `submittedAt` | `number` | The timestamp for when the mutation was submitted. | - |
50| <a id="property-variables"></a> `variables` | `TVariables` | The variables passed to `mutate` for this mutation. | [`MutationObserverBaseResult`](MutationObserverBaseResult.md).[`variables`](MutationObserverBaseResult.md#property-variables) |