Skip to content

Commit f60c661

Browse files
committed
docs(react-query): add info about the mutation function context
1 parent b7dd340 commit f60c661

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/framework/react/reference/useMutation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ mutate(variables, {
4545

4646
**Options**
4747

48-
- `mutationFn: (variables: TVariables) => Promise<TData>`
48+
- `mutationFn: (variables: TVariables, context: MutationFunctionContext) => Promise<TData>`
4949
- **Required, but only if no default mutation function has been defined**
5050
- A function that performs an asynchronous task and returns a promise.
5151
- `variables` is an object that `mutate` will pass to your `mutationFn`
52+
- `context` is an object containing the `mutationKey` and the mutation's `meta`
5253
- `gcTime: number | Infinity`
5354
- The time in milliseconds that unused/inactive cache data remains in memory. When a mutation's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different cache times are specified, the longest one will be used.
5455
- If set to `Infinity`, will disable garbage collection

0 commit comments

Comments
 (0)