You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last successfully resolved data for the mutation.
48
+
49
+
Example:
50
+
51
+
```ts
52
+
const mutation =newMutation({
53
+
queryClient,
54
+
mutationFn: async () =>api.updatePet(),
55
+
});
56
+
57
+
mutation.data; // updated pet or undefined
58
+
```
59
+
60
+
#### `error: TError | null`
61
+
62
+
The error object for the mutation, if an error was encountered.
63
+
64
+
#### `variables`
65
+
66
+
The last variables that were passed to the mutation function.
67
+
68
+
#### `isError`
69
+
A boolean variable derived from `status`. Will be `true` if the last mutation attempt resulted in an error.
70
+
71
+
#### `isIdle`
72
+
A boolean variable derived from `status`. Will be `true` if the mutation is in its initial state prior to executing.
73
+
74
+
#### `isPending`
75
+
A boolean variable derived from `status`. Will be `true` if the mutation is currently executing.
76
+
77
+
#### `isSuccess`
78
+
A boolean variable derived from `status`. Will be `true` if the last mutation attempt was successful.
79
+
80
+
#### `status`
81
+
The status of the mutation.
82
+
- Will be:
83
+
-`idle` initial status prior to the mutation function executing.
84
+
-`pending` if the mutation is currently executing.
85
+
-`error` if the last mutation attempt resulted in an error.
86
+
-`success` if the last mutation attempt was successful.
87
+
88
+
#### `failureCount`
89
+
The failure count for the mutation. Incremented every time the mutation fails.
90
+
91
+
#### `failureReason`
92
+
The failure reason for the mutation retry.
93
+
94
+
#### `isPaused`
95
+
will be `true` if the mutation has been paused. See [Network Mode](https://tanstack.com/query/v5/docs/framework/react/guides/network-mode) for more information.
96
+
97
+
#### `submittedAt`
98
+
The timestamp for when the mutation was submitted.
0 commit comments