Schema:
type Foo {
id: String! @id
bar: String!
}
Create Foo with:
mutation{
addFoo(input: [
{
id: "1"
bar: "2"
}
]) {
numUids
}
}
Update Foo using:
mutation {
updateFoo(input: {
filter: {
id: {eq: "1"}
}
remove: {
bar: null
}
}) {
foo{
bar
}
}
}
Error: "Non-nullable field 'bar' (type String!) was not present in result from Dgraph. GraphQL error propagation triggered."
Possibly related: [Bug] StringHashFilter of update mutation does not work correctly
Why is this important? Why do you send null in the first place?
Because I decide to remove that field based on a condition. I expect dgraph to not do anything if null is send on a not-required field. (This is obviously a toy example with one field where one could find workarounds. The real code has #number-of-fields optionals. Every field can either be removed, or not (set to null).
As this is the second bug of this nature that I found, I think you might want to check in general that you ignore optional fields when they are set to 0. Should be an easy fix, no?