Description
Description
Using openapi-react-query
the provided code from the client returns the wrong type from the queryOptions
, regardless of the API function behind.
When using useQuery
directly everything is inferred correctly.
Reproduction
Simply create a basic API function and inspect the evaluated types of both variants. The one coming from queryOptions
is always undefined
.
As an example code I used:
const { data: foo } = QAPI.useQuery("get", "/api/clients");
const { data: bar } = useQuery(QAPI.queryOptions("get", "/api/clients", {}));
foo
evaluates, while bar
does not.
A sidenote: For some reason I am forced to pass a third parameter to the queryOptions
call, whereas the docs state it is optional. When omitting the third parameter I am facing this error:
Expected result
The type should be identical between in both usage scenarios. Also the function signature should comply to the docs or vice versa.
Checklist
- I’m willing to open a PR (see CONTRIBUTING.md)