dgraph
dgraph copied to clipboard
[ENHANCEMENT]: Add Composite unique constraint in GraphQL schema
Use case and current behavior
GraphQL object can have an @id field but not constraints on a set of unique values.
Enhancement
From : https://github.com/dgraph-io/dgraph/issues/8179
Composite Uniques or @unique
type User @unique(fields: ["firstName", "lastName"]) {
email: String!
firstName: String!
lastName: String!
...
}
Would be the equivalent of SQL constraint:
ADD CONSTRAINT UNIQUE (firstName, lastName)