From c55f6987d33e7f1b1d388ae6fabab722b8e70095 Mon Sep 17 00:00:00 2001 From: baeharam Date: Sat, 21 Sep 2024 21:18:23 +0900 Subject: [PATCH 1/2] docs(react-query): fix queryClient description of useMutation and useQuery --- 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..4ef7e24adc 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. From 90efcd0ce012d7297022e81ad89079399e0946b0 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:52:10 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- docs/framework/react/reference/useMutation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/framework/react/reference/useMutation.md b/docs/framework/react/reference/useMutation.md index 4ef7e24adc..dc85eaeeec 100644 --- a/docs/framework/react/reference/useMutation.md +++ b/docs/framework/react/reference/useMutation.md @@ -25,7 +25,7 @@ const { mutationFn, gcTime, meta, - mutationKey, + mutationKey, networkMode, onError, onMutate, @@ -35,7 +35,7 @@ const { retryDelay, scope, throwOnError, - }, + }, queryClient, )