From your docs
Predicates can specify the @upsert directive if you want to do upsert operations against it. If the @upsert directive is specified then the index key for the predicate would be checked for conflict while committing a transaction, which would allow upserts.
This is how you specify the upsert directive for a predicate. This replaces the IgnoreIndexConflict field which was part of the mutation object in previous releases.
email: string @index(exact) @upsert .
Reading through the docs, it seems to me that @upsert can be set on the schema and it enforces uniqueness on a single predicate?
Follow up questions/examples
If I set this
// user node
Trying to set this would error, because it’s trying to create a new predicate with the same email, even though the node shape is different.
// alter ego node
So I can never add another, email@example.com email predicate, I could update it if I get hold of the node it’s attached to, or re-add it if I delete it (I guess). Is that right?
Even if you have the @upsert directive set on multiple predicates, to perform an upsert on multiple predicates we still have to search for the node we want with all the predicate values relevant to the upsert, then update that node al in a transaction.
Or is there some type of multi predicate node linking @upsert?