reym
CRUD/Schema/Field

@unique

Use the @unique directive to mark a field as unique. Any attempt to insert a duplicate value will result in an error.

This directive exists on object level as well: @unique

Example

user.graphql
type User @crudType {
    name: String! @unique
}

In this case, the name field is marked as unique.

On this page