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
originalArgs?:unknown// Arguments passed to the latest mutation call
333
+
originalArgs?:unknown// Arguments passed to the latest mutation call. Not available if using the `fixedCacheKey` option
332
334
data?:T// Returned result if present
333
335
error?:unknown// Error result if present
334
336
endpointName?:string// The name of the given endpoint for the mutation
@@ -359,7 +361,9 @@ selectFromResult: () => ({})
359
361
360
362
- **Parameters**
361
363
362
-
- `options`: A set of options that control the subscription behavior of the hook
364
+
- `options`: A set of options that control the subscription behavior of the hook:
365
+
- `selectFromResult`: A callback that can be used to customize the mutation result returned as the second item in the tuple
366
+
- `fixedCacheKey`: An optional string used to enable shared results across hook instances
363
367
364
368
- **Returns**: A tuple containing:
365
369
- `trigger`: A function that triggers an update to the data based on the provided argument. The trigger function returns a promise with the properties shown above that may be used to handle the behavior of the promise
When using `fixedCacheKey`, the `originalArgs` property is not able to be shared and will always be `undefined`.
171
+
172
+
:::
173
+
120
174
### Standard Mutation Example
121
175
122
-
This is a modified version of the complete example you can see at the bottom of the page to highlight the `updatePost` mutation. In this scenario, a post is fetched with `useQuery`, and then a`EditablePostName` component is rendered that allows us to edit the name of the post.
176
+
This is a modified version of the complete example you can see at the bottom of the page to highlight the `updatePost` mutation. In this scenario, a post is fetched with `useQuery`, and then an`EditablePostName` component is rendered that allows us to edit the name of the post.
0 commit comments