Skip to content

Commit dd6c61d

Browse files
authored
docs: mention query options strictly for useQuery (#1609)
* docs: mention query options strictly for useQuery This is in accordance with issues faced when trying use certain query options in `prefetchQuery` and `prefetchInfiniteQuery`. I opened a [discussion](#1596) and was [suggested](#1596 (reply in thread)) to open a PR to mention/describe the options available. * Update QueryClient.md * docs: fixed link to `useQuery` in `QueryClient` made changes as suggested in #1609 (comment)
1 parent 5db6868 commit dd6c61d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/pages/reference/QueryClient.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ try {
8888

8989
**Options**
9090

91-
The options for `fetchQuery` are exactly the same as those of [`useQuery`](#usequery).
91+
The options for `fetchQuery` are exactly the same as those of [`useQuery`](./useQuery), except the following: `enabled, refetchInterval, refetchIntervalInBackground, refetchOnWindowFocus, refetchOnReconnect, notifyOnChangeProps, notifyOnChangePropsExclusions, onSuccess, onError, onSettled, useErrorBoundary, select, suspense, keepPreviousData, placeholderData`; which are stictly for useQuery and useInfiniteQuery. You can check the [source code](https://github.com/tannerlinsley/react-query/blob/361935a12cec6f36d0bd6ba12e84136c405047c5/src/core/types.ts#L83) for more clarity.
9292

9393
**Returns**
9494

@@ -109,7 +109,7 @@ try {
109109

110110
**Options**
111111

112-
The options for `fetchInfiniteQuery` are exactly the same as those of [`useInfiniteQuery`](#useinfinitequery).
112+
The options for `fetchInfiniteQuery` are exactly the same as those of [`fetchQuery`](#queryclientfetchquery).
113113

114114
**Returns**
115115

@@ -131,7 +131,7 @@ await queryClient.prefetchQuery(queryKey)
131131

132132
**Options**
133133

134-
The options for `prefetchQuery` are exactly the same as those of [`useQuery`](#usequery).
134+
The options for `prefetchQuery` are exactly the same as those of [`fetchQuery`](#queryclientfetchquery).
135135

136136
**Returns**
137137

@@ -148,7 +148,7 @@ await queryClient.prefetchInfiniteQuery(queryKey, queryFn)
148148

149149
**Options**
150150

151-
The options for `prefetchInfiniteQuery` are exactly the same as those of [`useInfiniteQuery`](#useinfinitequery).
151+
The options for `prefetchInfiniteQuery` are exactly the same as those of [`fetchQuery`](#queryclientfetchquery).
152152

153153
**Returns**
154154

0 commit comments

Comments
 (0)