3

I'm trying to add a a Unique constraint to one of the fields of the my AppSync Model

The model is as follows

type User @model @key(name: "ByEmailAddress", fields: ["emailAddress"], queryField: "userByEmailAddress") {
    id: ID!
    fullName: String!
    emailAddress: AWSEmail!
    address: String!
}

I've tried to create Resolvers on the Email Address field, I've tried Pipeline Resolvers. But nothing has worked so far. I understand a field has to be a GSI for us to be able to use the expression attribute_not_exists in a resolver. That too hasn't worked out for me.

If you've done this before and can point me in the right direction, that would be great! Thanks!

Varun Rathore
  • 7,730
  • 3
  • 27
  • 30

0 Answers0