2

I can't for the life of me figure out how to have two different filter expressions in my Appsync resolver. I'm trying to retrieve the ID based on the two other pieces of data, email and username.

Here's how my resolver looks like:

{
  "version" : "2017-02-28",
  "operation" : "Scan",
  "filter" : {
    "expression" : "email = :email and username = :username",
    "expressionValues" : {
      ":email" : { "S" : "${context.arguments.email}" },
      ":username" : { "S" : "${context.arguments.username}" },
    },
  }
}

I get data: null as a response even if my request seems valid.

Any tips on how to do this?

Maxime Franchot
  • 1,015
  • 1
  • 10
  • 24

1 Answers1

3
{
    "version" : "2017-02-28",
    "operation" : "Scan",
    "filter": {
        "expression": "contains(email, :email) AND contains(username, :username)",
        "expressionValues" : {
            ":email": {
                "S": "${ctx.args.email}"
            },
            ":username": {
                "S": "${ctx.args.username}"
            },
        }
    }
}
m4n0
  • 29,823
  • 27
  • 76
  • 89
  • 2
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 17 '21 at 08:39