updateMutation removes fields when they are "set" to null in remove

I think this goes back to how DQL uses the Wild Card Delete.

When remove.bar is set with a value it uses:

# 0x1 would be replaced with the correct uid using upsert with XID Foo.id = 1
delete {
  <0x1> <Foo.bar> "2" .
}

When remove.bar is set with a nil value it uses:

delete {
  <0x1> <Foo.bar> * .
}

And a recent found “bug” is that this also was being applied when remove is supplied but nil (or empty object) it currently uses:

delete {
  <0x1> * * .
}

which deletes the entire node.

Umm, no. Imagine that the schema could be:

type Foo {
  id: String @id
  bar: [String!]!
}

Then your same mutation would simply not add another new null value. Also, looking at the schema from this view point, It helps understand why the need for the above bar: null to work to delete all bars or delete a specific bar by value.

1 Like