-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add __typename
to [Typescript], not just [Typescript Operations]
#1819
Comments
Hi @awdyson ! |
Waiting for this as well! Use case is the same: unions are not possible to discriminate without |
#1701 is now merged, but using the latest alpha I still do not get the behavior I was hoping for. What's the historical reason for My use case is that I use Apollo which automatically adds Perhaps an additional config option to generate |
Hi @cecchi The #1701 PR adds @cecchi what do you think about that? |
@dotansimha that sounds perfect. I'll see if I can put together a PR this weekend. |
Available in 1.2.0. |
My project uses unions that are quite large, so I import the fragment types to have access to
__typename
-- appreciate that inclusion by the way. For me,__typename
is a wonderful convenience toswitch
over, and this...is a lot kinder to interact with than this...
Describe the solution you'd like
Add (an option to include)
__typename
in the base [Typescript] plugin.Describe alternatives you've considered
Using
SomeTypeFragment
instead ofSomeType
. It's not a fun solution 😢The text was updated successfully, but these errors were encountered: