@@ -15,7 +15,7 @@ import {
15
15
type DataTag ,
16
16
useMutation ,
17
17
useQuery ,
18
- useSuspenseQuery ,
18
+ useSuspenseQuery ,
19
19
dataTagSymbol ,
20
20
dataTagErrorSymbol ,
21
21
} from "@tanstack/react-query" ;
@@ -39,10 +39,10 @@ export type QueryKey<
39
39
Path extends PathsWithMethod < Paths , Method > ,
40
40
Media extends MediaType ,
41
41
Init extends MaybeOptionalInit < Paths [ Path ] , Method > = MaybeOptionalInit < Paths [ Path ] , Method > ,
42
- Response extends Required < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > = Required <
43
- FetchResponse < Paths [ Path ] [ Method ] , Init , Media >
44
- > ,
45
- > = DataTag < readonly [ Method , Path , Init ] , Response [ "data" ] >
42
+ Response extends Required < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > = Required <
43
+ FetchResponse < Paths [ Path ] [ Method ] , Init , Media >
44
+ > ,
45
+ > = DataTag < readonly [ Method , Path , Init ] , Response [ "data" ] > ;
46
46
47
47
export type QueryOptionsFunction < Paths extends Record < string , Record < HttpMethod , { } > > , Media extends MediaType > = <
48
48
Method extends HttpMethod ,
@@ -207,15 +207,10 @@ export default function createClient<Paths extends {}, Media extends MediaType =
207
207
} ;
208
208
209
209
const queryOptions : QueryOptionsFunction < Paths , Media > = ( method , path , ...[ init , options ] ) => ( {
210
- queryKey : Object . assign ( init === undefined ? [ method , path ] as const : [ method , path , init ] as const , {
210
+ queryKey : Object . assign ( init === undefined ? ( [ method , path ] as const ) : ( [ method , path , init ] as const ) , {
211
211
[ dataTagSymbol ] : { } as any ,
212
212
[ dataTagErrorSymbol ] : { } as any ,
213
- } ) as QueryKey <
214
- Paths ,
215
- typeof method ,
216
- typeof path ,
217
- Media
218
- > ,
213
+ } ) as QueryKey < Paths , typeof method , typeof path , Media > ,
219
214
queryFn,
220
215
...options ,
221
216
} ) ;
0 commit comments