Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

infinitequeryoptions.md

132 lines3.0 KB

1---
2id: infiniteQueryOptions
3title: infiniteQueryOptions
4---
5​
6# Function: infiniteQueryOptions()
7​
8Allows to share and re-use infinite query options in a type-safe way.
9​
10The `queryKey` will be tagged with the type from `queryFn`.
11​
12## Param
13​
14The infinite query options to tag with the type from `queryFn`.
15​
16## infiniteQueryOptions(options)
17​
18```ts
19function infiniteQueryOptions<
20 TQueryFnData,
21 TError,
22 TData,
23 TQueryKey,
24 TPageParam,
25>(
26 options,
27): UndefinedInitialDataInfiniteOptions<
28 TQueryFnData,
29 TError,
30 TData,
31 TQueryKey,
32 TPageParam
33> &
34 object
35```
36​
37Allows to share and re-use infinite query options in a type-safe way.
38​
39The `queryKey` will be tagged with the type from `queryFn`.
40​
41### Type Parameters
42​
43β€’ **TQueryFnData**
44​
45β€’ **TError** = `Error`
46​
47β€’ **TData** = `InfiniteData`\<`TQueryFnData`, `unknown`\>
48​
49β€’ **TQueryKey** _extends_ `QueryKey` = `QueryKey`
50​
51β€’ **TPageParam** = `unknown`
52​
53### Parameters
54​
55β€’ **options**: [`UndefinedInitialDataInfiniteOptions`](../type-aliases/undefinedinitialdatainfiniteoptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
56​
57The infinite query options to tag with the type from `queryFn`.
58​
59### Returns
60​
61[`UndefinedInitialDataInfiniteOptions`](../type-aliases/undefinedinitialdatainfiniteoptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object`
62​
63The tagged infinite query options.
64​
65The tagged infinite query options.
66​
67### Param
68​
69The infinite query options to tag with the type from `queryFn`.
70​
71### Defined in
72​
73[infinite-query-options.ts:59](https://github.com/TanStack/query/blob/dac5da5416b82b0be38a8fb34dde1fc6670f0a59/packages/angular-query-experimental/src/infinite-query-options.ts#L59)
74​
75## infiniteQueryOptions(options)
76​
77```ts
78function infiniteQueryOptions<
79 TQueryFnData,
80 TError,
81 TData,
82 TQueryKey,
83 TPageParam,
84>(
85 options,
86): DefinedInitialDataInfiniteOptions<
87 TQueryFnData,
88 TError,
89 TData,
90 TQueryKey,
91 TPageParam
92> &
93 object
94```
95​
96Allows to share and re-use infinite query options in a type-safe way.
97​
98The `queryKey` will be tagged with the type from `queryFn`.
99​
100### Type Parameters
101​
102β€’ **TQueryFnData**
103​
104β€’ **TError** = `Error`
105​
106β€’ **TData** = `InfiniteData`\<`TQueryFnData`, `unknown`\>
107​
108β€’ **TQueryKey** _extends_ `QueryKey` = `QueryKey`
109​
110β€’ **TPageParam** = `unknown`
111​
112### Parameters
113​
114β€’ **options**: [`DefinedInitialDataInfiniteOptions`](../type-aliases/definedinitialdatainfiniteoptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
115​
116The infinite query options to tag with the type from `queryFn`.
117​
118### Returns
119​
120[`DefinedInitialDataInfiniteOptions`](../type-aliases/definedinitialdatainfiniteoptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object`
121​
122The tagged infinite query options.
123​
124The tagged infinite query options.
125​
126### Param
127​
128The infinite query options to tag with the type from `queryFn`.
129​
130### Defined in
131​
132[infinite-query-options.ts:91](https://github.com/TanStack/query/blob/dac5da5416b82b0be38a8fb34dde1fc6670f0a59/packages/angular-query-experimental/src/infinite-query-options.ts#L91)