Can I use multiple @id field in my Dgraph Type

Can I use multiple @id in a single type.

my schema is like following

type User@secret(field: "password") {
    uuid: String! @id @search(by:[fulltext,term])
    email: String! @search(by:[fulltext,term])
}

email field should also be unique and would be convenient as @id

yes, you can use it. Support for multiple id fields is recently added in the master branch.

1 Like

can i use it with slash graphql?

no, because slash graphql is still using old dgraph version.
it will be added in slash graphql with 21.03 release coming this month.

2 Likes

Okay. Thanks for the information.