How to generate return types? #8126
Unanswered
TheDutchCoder
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm going to switch from apollo codegen to
graphql-code-generator
, but I'm running into a problem: I can't get return types to be generated.What I mean is, for example a query on an account
GetAccount
, the generated type is:Which is not very useful, because that doesn't contain a type to import.
I would have expected something along the lines of:
My use-case is that I assign the returned result to a ref (reactive variable in Vue) and I need to tell it what type it'll be, which I can't if the returned result is just an object.
I'm probably doing something wrong on my end, so any help would be appreciated!
Edit: Using fragments I at least can get a specific return type, but it's not being used in the generated query type, so it's kind of useless?
Beta Was this translation helpful? Give feedback.
All reactions