Skip to content

Commit b873043

Browse files
committed
Link infinite query API ref
1 parent c4bbd5d commit b873043

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

docs/rtk-query/usage/infinite-queries.mdx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,21 @@ const pokemonApi = createApi({
140140

141141
There are 3 infinite query-related hooks:
142142

143-
1. [`useInfiniteQuery`]()
144-
145-
- Composes `useInfiniteQuerySubscription` and `useInfiniteQueryState`, and is the primary hook. Automatically triggers fetches of data from an endpoint, 'subscribes' the component to the cached data, and reads the request status and cached data from the Redux store.
146-
147-
2. [`useInfiniteQuerySubscription`]()
148-
149-
- Returns a `refetch` function and accepts all hooks options. Automatically triggers refetches of data from an endpoint, and 'subscribes' the component to the cached data.
150-
151-
3. [`useInfiniteQueryState`]()
152-
153-
- Returns the query state and accepts `skip` and `selectFromResult`. Reads the request status and cached data from the Redux store.
143+
1. [`useInfiniteQuery`](../api/created-api/hooks.mdx#useinfinitequery)
144+
- Composes `useInfiniteQuerySubscription` and `useInfiniteQueryState`, and is the primary hook. Automatically triggers fetches of data from an endpoint, 'subscribes' the component to the cached data, and reads the request status and cached data from the Redux store.
145+
2. [`useInfiniteQuerySubscription`](../api/created-api/hooks.mdx#useinfinitequerysubscription)
146+
- Returns a `refetch` function and `fetchNext/PreviousPage` functions, and accepts all hooks options. Automatically triggers refetches of data from an endpoint, and 'subscribes' the component to the cached data.
147+
3. [`useInfiniteQueryState`](../api/created-api/hooks.mdx#useinfinitequerystate)
148+
- Returns the query state and accepts `skip` and `selectFromResult`. Reads the request status and cached data from the Redux store.
154149

155150
In practice, the standard `useInfiniteQuery`-based hooks such as `useGetPokemonInfiniteQuery` will be the primary hooks used in your application, but the other hooks are available for specific use cases.
156151

157152
### Query Hook Options
158153

159154
The query hooks expect two parameters: `(queryArg?, queryOptions?)`.
160155

156+
The `queryOptions` object accepts [all the same parameters as `useQuery`](./queries.mdx#query-hook-options), including `skip`, `selectFromResult`, and refetching/polling options.
157+
161158
Unlike normal query hooks, your `query` or `queryFn` callbacks will receive a "page param" value to generate the URL or make the request. By default, the `initialPageParam` value specified in the endpoint will be used to make the first request, and then your `getNext/PreviousPageParam` callbacks will be used to calculate further page params as you fetch forwards or backwards.
162159

163160
If you want to start from a different page param, you may override the `initialPageParam` by passing it as part of the hook options:

0 commit comments

Comments
 (0)