TanStackT
TanStack4y ago
2 replies
urgent-maroon

What is the return type of useQuery?

I have a composable that runs useQuery and specifies a return type of: UseQueryReturnType<TypedMaterial[], unknown>
I get the error "TS2322: Type 'UseQueryReturnType<TypedMaterial[], unknown>' is not assignable to type 'UseQueryReturnType<TypedMaterial[], unknown, QueryObserverResult<TypedMaterial[], unknown>>"

When I change the return type to UseQueryReturnType<TypedMaterial[], unknown, QueryObserverResult<TypedMaterial[], unknown>>
I get the error "TS2322: Type 'UseQueryReturnType<TypedMaterial[], unknown>' is not assignable to type 'UseQueryReturnType<TypedMaterial[], unknown, QueryObserverResult<TypedMaterial[], unknown>>'."
Was this page helpful?