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.

I have checked and I still can not have multiple @Id.

resolving updateGQLSchema failed because input:598: Fields testId and id are listed as IDs for type User, but a type can have only one ID field. Pick a single field as the ID for type User.