File tree 1 file changed +9
-8
lines changed
packages/openapi-react-query/src
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -107,26 +107,27 @@ export type UseInfiniteQueryMethod<Paths extends Record<string, Record<HttpMetho
107
107
Path extends PathsWithMethod < Paths , Method > ,
108
108
Init extends MaybeOptionalInit < Paths [ Path ] , Method > ,
109
109
Response extends Required < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > ,
110
+ Query extends ParamsOption < FilterKeys < Paths [ Path ] , Method > > [ "params" ] extends { query : infer Query } ? Query : never ,
111
+ PageParamName extends keyof Query ,
110
112
Options extends Omit <
111
113
UseInfiniteQueryOptions <
112
114
Response [ "data" ] ,
113
115
Response [ "error" ] ,
114
116
InfiniteData < Response [ "data" ] > ,
115
117
Response [ "data" ] ,
116
118
QueryKey < Paths , Method , Path > ,
117
- unknown
119
+ Query [ PageParamName ]
118
120
> ,
119
- "queryKey" | "queryFn"
120
- > & {
121
- pageParamName : ParamsOption < FilterKeys < Paths [ Path ] , Method > > [ "params" ] extends { query : infer Query }
122
- ? keyof Query
123
- : never ;
124
- } ,
121
+ "queryKey" | "queryFn" | "initialPageParam"
122
+ > ,
125
123
> (
126
124
method : Method ,
127
125
url : Path ,
128
126
init : InitWithUnknowns < Init > ,
129
- options : Options ,
127
+ options : Options & {
128
+ pageParamName : PageParamName ;
129
+ initialPageParam : Query [ PageParamName ] ;
130
+ } ,
130
131
queryClient ?: QueryClient ,
131
132
) => UseInfiniteQueryResult < InfiniteData < Response [ "data" ] > , Response [ "error" ] > ;
132
133
You can’t perform that action at this time.
0 commit comments