graphql-code-generator
graphql-code-generator copied to clipboard
[typescript-react-query] add ability to customize react-query key with a directive
Is your feature request related to a problem? Please describe.
The react-query key is automatically generated from the query name, but there are situations where you might want to change the query key (e.g. for easier invalidation).
Describe the solution you'd like
Add a @reactQueryKey directive on QUERY to allow customizing the generated key.
Describe alternatives you've considered
Add an argument to the generated hook that allows specifying the key. This might be useful but also feels like it could be overkill.