@@ -22,6 +22,7 @@ import type {
2222} from "openapi-fetch" ;
2323import type { HttpMethod , MediaType , PathsWithMethod , RequiredKeysOf } from "openapi-typescript-helpers" ;
2424import type { DeepUnwrapRef , MaybeRefDeep } from "./utils" ;
25+ import type { Ref , UnwrapRef } from "vue" ;
2526
2627// Helper type to dynamically infer the type from the `select` property
2728type InferSelectReturnType < TData , TSelect > = TSelect extends ( data : TData ) => infer R ? R : TData ;
@@ -111,7 +112,10 @@ export type UseQueryMethod<Paths extends Record<string, Record<HttpMethod, {}>>,
111112 ...[ init , options , queryClient ] : RequiredKeysOf < Init > extends never
112113 ? [ InitWithUnknowns < Init > ?, Options ?, QueryClient ?]
113114 : [ InitWithUnknowns < Init > , Options ?, QueryClient ?]
114- ) => UseQueryReturnType < InferSelectReturnType < Response [ "data" ] , Options [ "select" ] > , Response [ "error" ] > ;
115+ ) => UseQueryReturnType < InferSelectReturnType < Response [ "data" ] , Options [ "select" ] > , Response [ "error" ] > & {
116+ data : InferSelectReturnType < Response [ "data" ] , Options [ "select" ] > | undefined ;
117+ error : Response [ "error" ] | null ;
118+ } ;
115119
116120export type UseInfiniteQueryMethod < Paths extends Record < string , Record < HttpMethod , { } > > , Media extends MediaType > = <
117121 Method extends HttpMethod ,
0 commit comments