From b5556ae8a10708b5e0bf9fc2b80cec83797ed19d Mon Sep 17 00:00:00 2001 From: Louis Young Date: Wed, 18 Jan 2023 18:16:29 +0000 Subject: [PATCH 1/2] docs(useMutation): clarify `mutationFn` option default --- docs/react/reference/useMutation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/react/reference/useMutation.md b/docs/react/reference/useMutation.md index c3ae969ce6..3ca25ae1d0 100644 --- a/docs/react/reference/useMutation.md +++ b/docs/react/reference/useMutation.md @@ -43,7 +43,8 @@ mutate(variables, { **Options** - `mutationFn: (variables: TVariables) => Promise` - - **Required** + - Optional + - Defaults to the global mutation configuration `mutationFn`, which is `undefined` by default. - A function that performs an asynchronous task and returns a promise. - `variables` is an object that `mutate` will pass to your `mutationFn` - `cacheTime: number | Infinity` From 88f7e1ebc85b5c3dd10cedc2b16c564f2546323c Mon Sep 17 00:00:00 2001 From: Louis Young Date: Fri, 20 Jan 2023 10:54:03 +0000 Subject: [PATCH 2/2] Make optionality consistent with `useQuery` documentation Co-authored-by: Dominik Dorfmeister --- docs/react/reference/useMutation.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/react/reference/useMutation.md b/docs/react/reference/useMutation.md index 3ca25ae1d0..36ee1c6652 100644 --- a/docs/react/reference/useMutation.md +++ b/docs/react/reference/useMutation.md @@ -43,8 +43,7 @@ mutate(variables, { **Options** - `mutationFn: (variables: TVariables) => Promise` - - Optional - - Defaults to the global mutation configuration `mutationFn`, which is `undefined` by default. + - **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` - `cacheTime: number | Infinity`