Describe the bug
With respect to what constitutes a valid type, the GraphQL spec states that for each field on a type corresponding to a field on an implemented interface:
field must return a type which is equal to or a sub-type of (covariant) the return type of implementedField field’s return type
Dgraph's implementation of GraphQL does not allow such covariant field implementation.
To Reproduce
Attempt to apply the following GraphQL schema to a Dgraph instance (POST to /admin/schema):
interface Vacancy {
roleName: String!
}
type DeveloperVacancy implements Vacancy {
roleName: String!
requiredLanguages: [String!]!
}
type DesignerVacancy implements Vacancy {
roleName: String!
}
interface Application {
vacancy: Vacancy!
}
type DeveloperApplication implements Application {
vacancy: DeveloperVacancy!
knownLanguages: [String!]!
}
type DesignerApplication implements Application {
vacancy: DesignerVacancy!
portfolioUrl: String!
}
Expected behavior
Schema is successfully applied to Dgraph instance.
Screenshots
An error message is returned:
resolving updateGQLSchema failed because input:19: For type DeveloperApplication to implement interface Application the field vacancy must have type Vacancy!\n (Locations: [{Line: 3, Column: 4}])
Environment
- Docker image
dgraph/standalone:v25.0.0-preview6
Describe the bug
With respect to what constitutes a valid
type, the GraphQL spec states that for each field on atypecorresponding to a field on an implementedinterface:Dgraph's implementation of GraphQL does not allow such covariant field implementation.
To Reproduce
Attempt to apply the following GraphQL schema to a Dgraph instance (POST to
/admin/schema):Expected behavior
Schema is successfully applied to Dgraph instance.
Screenshots
An error message is returned:
Environment
dgraph/standalone:v25.0.0-preview6