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
Use Orval to generate a react-query client from an OpenAPI specification.
Review the generated code for a query, such as useGetApiV3Ticker.
What happens?
The generated code structure for queries (e.g., useGetApiV3Ticker) does not provide a way to pass a queryClient as the second parameter to the useQuery hook from react-query. This limitation prevents the developer from customizing the query client at a hook level, which is necessary for certain scenarios.
I was expecting the generated code to provide a means to pass a custom queryClient as an optional second parameter to the generated hook. This would allow for greater flexibility and control over the query handling within the application, especially in cases where different components or hooks may require different query client configurations.
N/A - This issue pertains to the structure of the generated code rather than a runtime error.
Any other comments?
This limitation becomes particularly restrictive in frameworks like Astro, where sharing state between components using the Context API is not as straightforward as in other React environments. In such cases, being able to pass a custom queryClient directly to the useQuery hook becomes essential.
What are the steps to reproduce this issue?
react-query
client from an OpenAPI specification.useGetApiV3Ticker
.What happens?
The generated code structure for queries (e.g., useGetApiV3Ticker) does not provide a way to pass a queryClient as the second parameter to the useQuery hook from react-query. This limitation prevents the developer from customizing the query client at a hook level, which is necessary for certain scenarios.
Example generated hook
What were you expecting to happen?
I was expecting the generated code to provide a means to pass a custom queryClient as an optional second parameter to the generated hook. This would allow for greater flexibility and control over the query handling within the application, especially in cases where different components or hooks may require different query client configurations.
Expected generated hook
Any logs, error output, etc?
N/A - This issue pertains to the structure of the generated code rather than a runtime error.
Any other comments?
This limitation becomes particularly restrictive in frameworks like Astro, where sharing state between components using the Context API is not as straightforward as in other React environments. In such cases, being able to pass a custom queryClient directly to the useQuery hook becomes essential.
What versions are you using?
Operating System: N/A
Package Version: 6.25.0
Browser Version: N/A
The text was updated successfully, but these errors were encountered: