Return single object instead array for exactly one relation between node

While I can see your point, one of the issues is that you are asking Dgraph to change it’s result behavior so that it will return only a single item. The problem is that nothing in the schema is enforcing that relationship. This isn’t SQL where you can have a unique index on the foreign key to enforce this at the database level, which means that it is entirely possible that you are forcing Dgraph to choose which item to return from a set of nodes. Should it return the first? The last? The most recently updated? There has to be something in place which allows it to determine what action should be done. By “piggy-backing” off the first/last operator, this is handled inherently.

I’m actually wondering now if this is something that should be handled at the schema level. Just as you can define a predicate as being a list, maybe a predicate which is a uid should be capable of being defined as being a 1 to 1 relationship. Then nothing in the query would be required for Dgraph to drop the array, and Dgraph could potentially enforce this condition during all mutations.