Allow node reference replacements on 1-to-1 relationships #4136
Labels
area/mutations
Related to mutations JSON or RDF.
area/schema
Issues related to the schema language and capabilities.
exp/intermediate
Fixing this requires some experience with the project.
kind/enhancement
Something could be better.
priority/P2
Somehow important but would not block a release.
status/accepted
We accept to investigate/work on it.
Experience Report
We are building a large Saas solution powered by Dgraph. Naturally, we encountered several cases of 1-to-1 relationships that we needed to represent. Therefore we were quite excited when Dgraph announced native support for 1-to-1 relationships with the release of version 1.1 . As soon as the release was published we started migrating our software to the new version. During the migration we also tried out the new 1-to-1 feature and found that it was already a big help. However, we noticed, that when replacing a node reference, as in, for instance giving a User a different Team, an error was returned, warning us about either making the respective predicate a
[uid]
or removing the reference prior to the actual mutation. We discussed this issue in the discussion board and learned why this is the case. While we agree on the concerns expressed in the discussion, we still think simply replacing the node reference would be the expected behaviour and would make our code simpler.Here is a test case that expresses the behaviour we would like to see:
Any external references to support your case
Discussion board thread: https://discuss.dgraph.io/t/unexpected-bahaviour-when-mutating-1-to-1-relations/5180
The text was updated successfully, but these errors were encountered: