graphql-code-generator icon indicating copy to clipboard operation
graphql-code-generator copied to clipboard

[typescript-react-query] add ability to customize react-query key with a directive

Open sciyoshi opened this issue 3 years ago • 0 comments

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.

sciyoshi avatar Jul 19 '22 21:07 sciyoshi