-
-
Notifications
You must be signed in to change notification settings - Fork 464
Open
Feature
Copy link
Labels
tanstack-queryTanStack Query related issueTanStack Query related issue
Milestone
Description
Is your feature request related to a problem? Please describe.
Currently, when generating React Query hooks using Orval, the queryKey
returned from the ...QueryKey
functions only includes the API path, for example:
return [`/some/path`] as const;
This makes it difficult to uniquely identify or cache queries in larger projects where many paths may be dynamic or similar.
Describe the solution you’d like
I’d like to request an option in Orval’s config to include the operationId alongside the API path in the queryKey, like:
return ['getSomeData', `/some/path`] as const;
Describe alternatives you’ve considered
We are currently using a custom post-generation script to parse the generated api-docs.ts and inject the operationId manually, but this approach is brittle and could break with future Orval updates.
Additional context
It would be great if this could be implemented as an opt-in configuration flag, for example:
reactQuery:
includeOperationIdInQueryKey: true
Thanks for the great tool and all your hard work!
Metadata
Metadata
Assignees
Labels
tanstack-queryTanStack Query related issueTanStack Query related issue