Open History to see the last commit
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)