Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT]: add @unique constraint in GraphQL Schema #8866

Closed
rderbier opened this issue Jun 9, 2023 · 1 comment
Closed

[ENHANCEMENT]: add @unique constraint in GraphQL Schema #8866

rderbier opened this issue Jun 9, 2023 · 1 comment
Labels
dgraph Issue or PR created by an internal Dgraph contributor. kind/enhancement Something could be better. Stale

Comments

@rderbier
Copy link
Member

rderbier commented Jun 9, 2023

Use case and current behavior

GraphQL schema has @id but not unique constraint.

Enhancement

add @unique directive at field level.
From : #8179


Multiple Uniques or @unique

type User {
  id: ID! @id
  username: String! @unique
  email: String! @unique
}

That would be the equivalent of SQL

ADD CONSTRAINT UNIQUE (username)
ADD CONSTRAINT UNIQUE (email)

@rderbier rderbier added the kind/enhancement Something could be better. label Jun 9, 2023
@MichelDiz MichelDiz added the dgraph Issue or PR created by an internal Dgraph contributor. label Jun 26, 2023
Copy link

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Jul 17, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgraph Issue or PR created by an internal Dgraph contributor. kind/enhancement Something could be better. Stale
Development

No branches or pull requests

2 participants