A union type cannot satisfy an interface even if each child type does#1488
A union type cannot satisfy an interface even if each child type does#1488derek-miller wants to merge 1 commit intographql:masterfrom derek-miller:master
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
@derek-miller It looks like GraphQL specification doesn't handle this case:
Spec doesn't define
Proposed behaviour requires a non trivial change to the spec and should be accepted to the spec first: https://github.com/facebook/graphql |
|
Actually even this part is enough to reject schema:
|
|
I'm going to close this: if you want to propose allowing Unions to be sub-types of Interfaces, that would be a different proposal, which would need to include a PR on the GraphQL Spec as well as updates here to showcase the implementation (as @IvanGoncharov mentioned). @derek-miller thank you, though, for asking a detailed question with actual test cases! The presentation of your question as a PR made it easier to understand what was desired. |
Below is a simplified example of my schema that is failing to validate:
With error message:
It appears that the union type does not properly carry through that it implements the
Nodeinterface even though all its child types do. Is this expected behavior or an issue with the validator?