Skip to content

Commit 9da00d6

Browse files
docs(react-query): fix queryClient description of useMutation and use… (#8077)
* 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>
1 parent 1104948 commit 9da00d6

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

docs/framework/react/reference/useMutation.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,24 @@ const {
2020
status,
2121
submittedAt,
2222
variables,
23-
} = useMutation({
24-
mutationFn,
25-
gcTime,
26-
meta,
27-
mutationKey,
28-
networkMode,
29-
onError,
30-
onMutate,
31-
onSettled,
32-
onSuccess,
33-
retry,
34-
retryDelay,
35-
scope,
36-
throwOnError,
37-
})
23+
} = useMutation(
24+
{
25+
mutationFn,
26+
gcTime,
27+
meta,
28+
mutationKey,
29+
networkMode,
30+
onError,
31+
onMutate,
32+
onSettled,
33+
onSuccess,
34+
retry,
35+
retryDelay,
36+
scope,
37+
throwOnError,
38+
},
39+
queryClient,
40+
)
3841

3942
mutate(variables, {
4043
onError,
@@ -43,7 +46,7 @@ mutate(variables, {
4346
})
4447
```
4548

46-
**Options**
49+
**Parameter1 (Options)**
4750

4851
- `mutationFn: (variables: TVariables) => Promise<TData>`
4952
- **Required, but only if no default mutation function has been defined**
@@ -98,6 +101,9 @@ mutate(variables, {
98101
- `meta: Record<string, unknown>`
99102
- Optional
100103
- 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`).
104+
105+
**Parameter2 (QueryClient)**
106+
101107
- `queryClient?: QueryClient`,
102108
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
103109

docs/framework/react/reference/useQuery.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const {
5858
)
5959
```
6060

61-
**Options**
61+
**Parameter1 (Options)**
6262

6363
- `queryKey: unknown[]`
6464
- **Required**
@@ -168,6 +168,9 @@ const {
168168
- `meta: Record<string, unknown>`
169169
- Optional
170170
- 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`.
171+
172+
**Parameter2 (QueryClient)**
173+
171174
- `queryClient?: QueryClient`,
172175
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
173176

0 commit comments

Comments
 (0)