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`](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`](UndefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object`
62β
63The tagged infinite query options.
64β
65### Defined in
66β
67[infinite-query-options.ts:59](https://github.com/TanStack/query/blob/27861961bbb36e9bc25fcd45cff21b5645f02f9b/packages/angular-query-experimental/src/infinite-query-options.ts#L59)
68β
69## infiniteQueryOptions(options)
70β
71```ts
72function infiniteQueryOptions<
73 TQueryFnData,
74 TError,
75 TData,
76 TQueryKey,
77 TPageParam,
78>(
79 options,
80): DefinedInitialDataInfiniteOptions<
81 TQueryFnData,
82 TError,
83 TData,
84 TQueryKey,
85 TPageParam
86> &
87 object
88```
89β
90Allows to share and re-use infinite query options in a type-safe way.
91β
92The `queryKey` will be tagged with the type from `queryFn`.
93β
94### Type Parameters
95β
96β’ **TQueryFnData**
97β
98β’ **TError** = `Error`
99β
100β’ **TData** = `InfiniteData`\<`TQueryFnData`, `unknown`\>
101β
102β’ **TQueryKey** _extends_ `QueryKey` = `QueryKey`
103β
104β’ **TPageParam** = `unknown`
105β
106### Parameters
107β
108β’ **options**: [`DefinedInitialDataInfiniteOptions`](DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\>
109β
110The infinite query options to tag with the type from `queryFn`.
111β
112### Returns
113β
114[`DefinedInitialDataInfiniteOptions`](DefinedInitialDataInfiniteOptions.md)\<`TQueryFnData`, `TError`, `TData`, `TQueryKey`, `TPageParam`\> & `object`
115β
116The tagged infinite query options.
117β
118### Defined in
119β
120[infinite-query-options.ts:91](https://github.com/TanStack/query/blob/27861961bbb36e9bc25fcd45cff21b5645f02f9b/packages/angular-query-experimental/src/infinite-query-options.ts#L91)