Closed ThisaruGuruge closed 3 years ago
Having second thoughts about this.
@shafreenAnfar Should we not allow to return union types directly, or should we not support it?
The GraphQL way is to define Union types separately, and use them. But we can support it without defining union type separately since we have the language level support for unions.
WDYT?
Closing this since we are going to support returning union types directly from GraphQL resources.
Description: When a field in a GraphQL schema is a union type, the user should define a separate type for that particular union type. Currently, the compiler plugin allows to directly return union types, but it should be throwing a compiler error.
Describe your problem(s) Following should be valid:
But the following code should be invalid: