graphql-js
graphql-js copied to clipboard
allow unions to declare implementation of interfaces
See: https://github.com/graphql/graphql-spec/pull/939
Deploy Preview for compassionate-pike-271cb3 ready!
Name | Link |
---|---|
Latest commit | 986b79a94a9053062325dd9ca5bbbb810e7854d5 |
Latest deploy log | https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/628c8cd58fe5d90008b8f580 |
Deploy Preview | https://deploy-preview-3527--compassionate-pike-271cb3.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋
Supported commands
Please post this commands in separate comments and only one per comment:
-
@github-actions run-benchmark
- Run benchmark comparing base and merge commits for this PR -
@github-actions publish-pr-on-npm
- Build package from this PR and publish it on NPM
https://github.com/graphql/graphql-spec/pull/939#issuecomment-1092282972
Should queries be allowed to select fields directly on the union now that the union definitely implements the field?
Some exploration within the reference implementation yielded that queries of this type would execute anyway without a problem, but fail validation because of the FieldsOnCorrectTypeRule.
So, this rule would possibly need to be updated for a union to find the field on one of the interfaces it implements!
Decision Record We decided at the last WG that if unions implement interfaces, then they have directly querable fields. This PR and the spec PR have been updated with the changes for introspection, validation.
Now all composite types have a getFields
method!
Actually, this naive field copying from the interfaces to the Union does not account for different interfaces with valid overlapping fields like new arguments with defaults. Work to do!