-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(GraphQL):This PR allows to use fragments on interfaces while querying other interface. #6964
Conversation
Deploy preview for dgraph-docs ready! Built with commit 08393f5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jatindevdg, @MichaelJCompton, and @pawanrawal)
graphql/resolve/query_test.yaml, line 1939 at r2 (raw file):
"queryCharacter with fragment on interface and type"
fragment on interface implemented by type which implements multiple interfaces in query on some other interface
graphql/schema/request.go, line 285 at r2 (raw file):
Type
typ
local variables should always be lowercase. So, lets change this to typ
(as type
is a keyword)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @abhimanyusinghgaur, @MichaelJCompton, and @pawanrawal)
graphql/resolve/query_test.yaml, line 1939 at r2 (raw file):
Previously, abhimanyusinghgaur (Abhimanyu Singh Gaur) wrote…
"queryCharacter with fragment on interface and type"
fragment on interface implemented by type which implements multiple interfaces in query on some other interface
changed.
graphql/schema/request.go, line 285 at r2 (raw file):
Previously, abhimanyusinghgaur (Abhimanyu Singh Gaur) wrote…
Type
typ
local variables should always be lowercase. So, lets change this to
typ
(astype
is a keyword)
Ohh...changed.
…ying other interface. (#6964) Fixes GRAPHQL-863 Consider the below schema, Human implements both character and Employee interfaces. interface Employee { ... } interface Character { ... } type Human implements Character & Employee { ... } type Droid implements Character { ... } While Querying Character interfaces which can return an object of Droid or Human, we will be able to use fragment on Employee interface if the returned object is of type Human and ignores it if the returned object is of type Droid. (cherry picked from commit f810e4e)
…ying other interface. (#6964) (#6966) Fixes GRAPHQL-863 Consider the below schema, Human implements both character and Employee interfaces. interface Employee { ... } interface Character { ... } type Human implements Character & Employee { ... } type Droid implements Character { ... } While Querying Character interfaces which can return an object of Droid or Human, we will be able to use fragment on Employee interface if the returned object is of type Human and ignores it if the returned object is of type Droid. (cherry picked from commit f810e4e)
Fixes GRAPHQL-863
Consider the below schema, Human implements both character and Employee interfaces.
While Querying
Character
interfaces which can return an object of Droid or Human, we will be able to use fragment onEmployee
interface if the returned object is of typeHuman
and ignores it if the returned object is of typeDroid
.This change is