-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include __typename on interface-typed fragments
We ask for `__typename` on interface-typed fields so that we know which type to use when unmarshaling. We never strictly need this for fragments, because the context into which they're spread must either have `__typename` or must be of concrete type. But a few cases have come up where it would be somewhat convenient: first, if you're using genqlient's types for mocking (not really supported right now, but possible); and second, for consistency if we add an option to "flatten" fragments (#30), which would effectively drop the `__typename` field from the structs otherwise. Neither is a deeply compelling reason, I feel, but it's not too hard to do so we may as well. Test plan: make check Reviewers: marksandstrom, steve, jvoll, adam, miguel, mahtab
- Loading branch information
1 parent
5995653
commit bdc8720
Showing
4 changed files
with
73 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 21 additions & 6 deletions
27
...ata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters