Revert "Fix marshaling interfaces and union types (#3211)" #3289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 3556475.
Got a report that since #3211 was merged, the generation seems to be broken.
The name of Go elements are no longer equal to the name of GQL types.
For instance, generating code with GQL type as:
Will result in generated code like this:
As
CliTargetSettingsResult
andTargetSettings
are Go types and not a GQL types, this will always be 0 and returngraphql.Empty{}
.On top of that, this could lead to invalid JSON as a response. As Empty{} will be marshaled as an empty string I'm able to generate response data like
Which panics on the JSON marshaling.