Skip to content

Commit

Permalink
docs(react-query): fix queryClient description of useMutation and use… (
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
baeharam and autofix-ci[bot] authored Sep 21, 2024
1 parent 1104948 commit 9da00d6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
38 changes: 22 additions & 16 deletions docs/framework/react/reference/useMutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -43,7 +46,7 @@ mutate(variables, {
})
```

**Options**
**Parameter1 (Options)**

- `mutationFn: (variables: TVariables) => Promise<TData>`
- **Required, but only if no default mutation function has been defined**
Expand Down Expand Up @@ -98,6 +101,9 @@ mutate(variables, {
- `meta: Record<string, unknown>`
- 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.

Expand Down
5 changes: 4 additions & 1 deletion docs/framework/react/reference/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const {
)
```

**Options**
**Parameter1 (Options)**

- `queryKey: unknown[]`
- **Required**
Expand Down Expand Up @@ -168,6 +168,9 @@ const {
- `meta: Record<string, unknown>`
- 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.

Expand Down

0 comments on commit 9da00d6

Please sign in to comment.