-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: deal with interface inheritance when retrieving selectionset (#3793
) Followup to #3718, this changeset makes sure we're able to generate the most concrete selection set for a given operation. This means finding the most concrete type we can when we're dealing with interfaces: - If InterfaceA implements InterfaceB, use InterfaceA as current_type to generate an inline fragment's selection set Given the following invariants: ```graphql interface OperationItemStuff implements OperationItem ``` For ```graphql fragment OperationItemFragment on OperationItem { ... on OperationItemStuff { stuff } } ``` The most concrete interface to generate fields for `OperationItemStuff` is not `OperationItem`, so we narrow down the selection to `OperationItemStuff`. The fixes for #3718 still apply, IE: Given the following invariants: ```graphql type Dog implements Animal ``` For ```graphql ...on Animal { id ...on Dog { name } } ``` The most concrete type to generate a selection set for `Dog` is not `Animal`, so we narrow down the selection to `Dog`.
- Loading branch information
1 parent
9481e8e
commit 619e284
Showing
3 changed files
with
248 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters