How can I generate partial return types for queries? #5330
Answered
by
ardatan
kylemiller3
asked this question in
Q&A
-
Apologies if this is a common issue but I want to be able to generate a type in Typescript for partial fetches. For instance, if I have a Human and it has age, gender and height and my generated query just fetches height I would like a type that reflects that specific query. Not sure how to accomplish type safety without ugly copy and paste of the auto-generated types. |
Beta Was this translation helpful? Give feedback.
Answered by
ardatan
Dec 29, 2020
Replies: 1 comment 2 replies
-
'typescript-operations' plugins generates types for the queries. You can test it on the website; |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
kylemiller3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
'typescript-operations' plugins generates types for the queries. You can test it on the website;
https://graphql-code-generator.com
Is that what you're looking for?