When using the delete mutation for interfaces, inverse relationships of implementing types are not correctly handled.
Schema:
type Foo {
id: String! @id
bars: [Bar!]! @hasInverse(field: foo)
}
interface Cuid {
id: String! @id
}
type Bar implements Cuid {
foo: Foo!
}
Add Foo with Bar:
mutation {
addFoo(input: { id: "foo", bars: [{ id: "bar" }] }) {
numUids
}
}
Delete Bar:
mutation {
deleteCuid(filter: { id: { eq: "bar" } }) {
msg
}
}
Query Foo and Bars:
query {
queryFoo {
id
bars {
id
}
}
}
Error:
Non-nullable field 'id' (type String!) was not present in result from Dgraph. GraphQL error propagation triggered.
"path": [
"queryFoo",
0,
"bars",
0,
"id"
]
When using the deleteBar
mutation instead, the inverse relationship is correctly deleted.
Iād expect the deleteCuid
mutation to do the same.