Using Dgraph 20.11.rc3 the behavior is still wrong
Conditions:
Type A implements interface B and C
Action:
query {
getB {
... on C {
some C Fields
}
}
}
Expected behavior:
The fragment on C should resolve for A because it implements the 2 interfaces
Actual Behaviour:
Graphql do not resolve any entity for the getB query, returning null
Is seems that while the fragment resolution on interface works, now the query do not correctly resolve on interface, making the whole interface architecture inutilizable.
Hi @Luscha, can you please specify schema and query for which you are getting error. I am not able to get what you mean by Graphql do not resolve any entity for thegetB query, returning null
I am trying below and it’s working for me.
Schema:
interface Meta {
id: String! @id @search(by: [hash])
}
interface Generic {
names: [String!]!
}
type Movie implements Meta & Generic {
description: String!
}
mutation:
mutation{
addMovie(input:[{id:"abc",names:["xyz"],description:"dgraph"}]){
movie{
id
names
description
}
}
}
query :
query {
getMeta(id:"abc") {
id
... on Generic {
names
}
}
}
you need to mention dgraph.type of the object in RDF to get response in graphql query. In case of interfaces we need to mention all the possible types that the resulting object can be of.
In your RDF you need to add these lines and then graphql query will work.