are generated types for unions/interfaces correct? #5878
Unanswered
PiotrFidurski
asked this question in
Q&A
Replies: 2 comments
-
@PiotrFidurski did you ever figure this out? while not a big deal to type narrow like this i just wonder if there is a way to have this configured to do this for us. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm also interested to know if there is a way to configure this. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hello, I'm using interfaces/unions in my schema, and everytime I use generated types I'm checking
__typename
field to pick the correct type from interface.packages
Here's the query and types.
what gets generated:
how i use generated types:
when i dont check for
__typename
I get this errorif its just node interface e.g:
Is it intented behaviour, having to check
__typename
field whenever u need to use whats returned from query, or is something wrong with my schema which looks to me like a regular interface/unionBeta Was this translation helpful? Give feedback.
All reactions