* Don’t Swift-ify meta field names - they shouldn’t look like regular fields (#97)
* Fix addTypename for Swift target
* Revert "Use disjoint unions on fragments w/ interfaces (#86)"
This reverts commit c5452824e5.
* progress
* fix fragment spread handling
* handle __typename fields by properly generating types with string literals based on type condition
* fix handling of fragment spreads and inline fragments within fragments on concrete type conditions
* Fix handling property declarations of concrete types
* use updates to IR from #128
* rehook up add-typename
* fix up tests by passing in addTypename: true
* remove some unnecessary fields
* add comments to confusing bits
* Fixed several issues post-rebase
During the rebase I mainly favored master but this PR rolled back features from there. This PR mainly fixes that.
* copy over flow target updates to typescript target
* Fix a few indentation issues
* fix rebase error on validations
* ExplicitTypename should only error on the swift target
* fix missed rebase
* Handle fragment interfaces better
Instead of concat'ing inline fragment fields, it makes more sense
to create a type for each inline fragment and then union'ing them.
* Implement typescript inline fragment interfaces
* Update typescript snapshots
* Remove explicit typename validation for non-Swift targets
* Do not set description on field for __typename
If we're allowing explicit typename, we cannot make the assumption
that every field is a normal field -- rather that some fields
are introspection fields that do not have a description.
* Retrieve the __typename from the parentType
* remove console.log
* some minor fixes
* Handle fragment interfaces better
Instead of concat'ing inline fragment fields, it makes more sense
to create a type for each inline fragment and then union'ing them.
* Implement typescript inline fragment interfaces
* Update typescript snapshots
* Only generate typename within the flow/typescript codegen instead of adding it to the IR
* Fix fragments in various areas
- Fix fragments that are in selection sets that are not fragments
- Fix fragments in fragment on interface in fragment on interface
- Ensure works with type alias
* Use better unique names to name resulting fragment types
- If inline fragments in fragments, nothing changes
- If inline fragments in a selection set that is not part of a fragment,
use the operation name as the suffix.
* get __typename added to all the right places
* Handle fragment interfaces better
Instead of concat'ing inline fragment fields, it makes more sense
to create a type for each inline fragment and then union'ing them.
* Implement typescript inline fragment interfaces
* Update typescript snapshots
* Remove explicit typename validation for non-Swift targets
* Do not set description on field for __typename
If we're allowing explicit typename, we cannot make the assumption
that every field is a normal field -- rather that some fields
are introspection fields that do not have a description.
* Retrieve the __typename from the parentType
* remove console.log
* some minor fixes
* Only generate typename within the flow/typescript codegen instead of adding it to the IR
* Fix fragments in various areas
- Fix fragments that are in selection sets that are not fragments
- Fix fragments in fragment on interface in fragment on interface
- Ensure works with type alias
* Use better unique names to name resulting fragment types
- If inline fragments in fragments, nothing changes
- If inline fragments in a selection set that is not part of a fragment,
use the operation name as the suffix.
* get __typename added to all the right places
* downgrade inflected
It turned out that TypeScript generated files does not end with a new
line character. The issue lies in the fact that
`generator.printOnNewline()` method was used that accepts a string
parameter. If the string is `falsy` it does nothing. The fix is to use
`printNewline()` method instead.
The tests were passing because the tag helper `stripIndent` is deleting
the new line charter when the line is ‘empty’. The tests are fixed by
appending the new line character to the expected value.