Skip to content

Commit

Permalink
docs(react-query): add info about the mutation function context
Browse files Browse the repository at this point in the history
  • Loading branch information
asermax committed Apr 28, 2024
1 parent b7dd340 commit f60c661
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/framework/react/reference/useMutation.md
Expand Up @@ -45,10 +45,11 @@ mutate(variables, {

**Options**

- `mutationFn: (variables: TVariables) => Promise<TData>`
- `mutationFn: (variables: TVariables, context: MutationFunctionContext) => Promise<TData>`
- **Required, but only if no default mutation function has been defined**
- A function that performs an asynchronous task and returns a promise.
- `variables` is an object that `mutate` will pass to your `mutationFn`
- `context` is an object containing the `mutationKey` and the mutation's `meta`
- `gcTime: number | Infinity`
- 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.
- If set to `Infinity`, will disable garbage collection
Expand Down

0 comments on commit f60c661

Please sign in to comment.