You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The select property of the query options does not infer the type correctly.
Reproduction
Simply return a different type from the select call.
Example:
const{data: firstUser}=QAPI.useQuery("get","/api/users",// endpoint usually returns an array of users, e.g. User[]{},{select: (data)=>data[0],// want to return something different here, i.e. User},);
In this case you get an error from the compiler stating Type User is not assignable to type User[] ...
Description
The
select
property of the query options does not infer the type correctly.Reproduction
Simply return a different type from the select call.
Example:
In this case you get an error from the compiler stating
Type User is not assignable to type User[]
...Expected result
Type inference just works.
Checklist
The text was updated successfully, but these errors were encountered: