From 9da00d610ab437ad1da6854c9a5697874ebebb7e Mon Sep 17 00:00:00 2001 From: baeharam Date: Sat, 21 Sep 2024 22:52:41 +0900 Subject: [PATCH] =?UTF-8?q?docs(react-query):=20fix=20queryClient=20descri?= =?UTF-8?q?ption=20of=20useMutation=20and=20use=E2=80=A6=20(#8077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(react-query): fix queryClient description of useMutation and useQuery * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- docs/framework/react/reference/useMutation.md | 38 +++++++++++-------- docs/framework/react/reference/useQuery.md | 5 ++- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/docs/framework/react/reference/useMutation.md b/docs/framework/react/reference/useMutation.md index 6c4469d4fe..dc85eaeeec 100644 --- a/docs/framework/react/reference/useMutation.md +++ b/docs/framework/react/reference/useMutation.md @@ -20,21 +20,24 @@ const { status, submittedAt, variables, -} = useMutation({ - mutationFn, - gcTime, - meta, - mutationKey, - networkMode, - onError, - onMutate, - onSettled, - onSuccess, - retry, - retryDelay, - scope, - throwOnError, -}) +} = useMutation( + { + mutationFn, + gcTime, + meta, + mutationKey, + networkMode, + onError, + onMutate, + onSettled, + onSuccess, + retry, + retryDelay, + scope, + throwOnError, + }, + queryClient, +) mutate(variables, { onError, @@ -43,7 +46,7 @@ mutate(variables, { }) ``` -**Options** +**Parameter1 (Options)** - `mutationFn: (variables: TVariables) => Promise` - **Required, but only if no default mutation function has been defined** @@ -98,6 +101,9 @@ mutate(variables, { - `meta: Record` - Optional - If set, stores additional information on the mutation cache entry that can be used as needed. It will be accessible wherever the `mutation` is available (eg. `onError`, `onSuccess` functions of the `MutationCache`). + +**Parameter2 (QueryClient)** + - `queryClient?: QueryClient`, - Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used. diff --git a/docs/framework/react/reference/useQuery.md b/docs/framework/react/reference/useQuery.md index 5677e92897..eeffde61d4 100644 --- a/docs/framework/react/reference/useQuery.md +++ b/docs/framework/react/reference/useQuery.md @@ -58,7 +58,7 @@ const { ) ``` -**Options** +**Parameter1 (Options)** - `queryKey: unknown[]` - **Required** @@ -168,6 +168,9 @@ const { - `meta: Record` - Optional - If set, stores additional information on the query cache entry that can be used as needed. It will be accessible wherever the `query` is available, and is also part of the `QueryFunctionContext` provided to the `queryFn`. + +**Parameter2 (QueryClient)** + - `queryClient?: QueryClient`, - Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.