-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow unions to declare implementation of interfaces #3527
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for compassionate-pike-271cb3 ready!
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 commandsPlease post this commands in separate comments and only one per comment:
|
- Spec PR: graphql/graphql-spec#939 - graphql-js PR (WIP): graphql/graphql-js#3527
* add agenda item for unions implementing interfaces - Spec PR: graphql/graphql-spec#939 - graphql-js PR (WIP): graphql/graphql-js#3527 * Update agendas/2022/2022-04-07.md Co-authored-by: Benjie Gillam <[email protected]>
So, this rule would possibly need to be updated for a union to find the field on one of the interfaces it implements! |
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
Intersections of unions and interfaces can be considered to "implement" their unions and interface members. A type with a field of type Intersection will satisfy an interface where the field defined in the interface is one of the member types of the intersection. Alternative to graphql#3527
6f229f7
to
ecd0e3c
Compare
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 |
WIP: more tests required complete code coverage is already there, but goal is to have a test where union implements an interface wherever there is a test for an interface implementing interface
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! |
* add agenda item for unions implementing interfaces - Spec PR: graphql/graphql-spec#939 - graphql-js PR (WIP): graphql/graphql-js#3527 * Update agendas/2022/2022-04-07.md Co-authored-by: Benjie Gillam <[email protected]>
See: graphql/graphql-spec#939