Moved from GitHub dgraph/5512
Posted by sessionboy:
What you wanted to do
I am using GraphQL ±.
I want to achieve a unique index at the database level. I know that GraphQL is planning to support it, but I hope that GraphQL ± will also support it.
I know that the uniqueness can be verified before inserting the record, but I ca n’t guarantee misoperation or someone else inserts the record without verifying the uniqueness. Once this happens it will be extremely bad.
I think like other databases, it is very necessary to achieve uniqueness at the database level。
name: string @index(exact) @unique . username: string @index(exact) @unique . email: string @unique . phone_number: string @unique . ...
I only need to add a
@unique so I don’t need to worry about it anymore, and I can save a lot of extra work.