Moved from GitHub dgraph/5232
Posted by sessionboy:
What you wanted to do
Expect team to provide support for multiple unique fields in dgraph GraphQL, this is a very common requirement, like this:
type User {
id: ID!
name: String! @unique
username: String! @unique
phone_number: String! @unique
email: String @unique
...
}
The unique field is allowed to be empty, and no verification is performed when the value of the unique field is empty. For example email above.
Any external references to support your case
prisma provides a great implementation for this, which can be used as a reference.