I have the following types and schema to have a 1-to-1 association between an AccessConfig node and a Permissions node:
type AccessConfig {
delegate: bool
delegateTo: uid
finDelegatedTo: uid
permissions: Persmissions
}
type Persmissions {
publicRead: bool
publicWrite: bool
}
permissions: uid .
I can create the AccessConfig node and set the Permissions with
_:accessConfig <permissions> <0x...> .
but when I try to update the Permissions reference to another Permissions node with the triad
<0x(access config uid)> <permissions> <0x(new permissions node uid)> .
I get the following error:
"2 UNKNOWN: cannot add value with uid 0x(new permissions node uid) to predicate permissions because one of the existing values does not match this uid, either delete the existing values first or modify the schema to 'permissions: [uid]'"
}
I don’t understand the error. Updating the existing value with the new one without having an array if [uid] is precisely what I want.
You can recreate the error installing and running npm test of this branch
https://github.com/uprtcl/js-uprtcl-server/tree/dgraph-issue