Unexpected bahaviour when mutating 1-to-1 relations

To ensure that the relationship will be 1:1 you need to set the schema before any mutations/operations. Cuz when you mutate, you eventually will create new value types. It means Dgraph will assume types if you don’t define them. In this case, if you don’t define the pred as “pred: uid .”. It will assume that it is 1:N and set as “pred: [uid]”.