I'm trying to write a resolver template for a Scan that filters by owner.
Here is what I tried so far (this is my request template):
#set( $identityValue = $util.defaultIfNull($ctx.identity.claims.get("username"),
$util.defaultIfNull($ctx.identity.claims.get("cognito:username"), "___xamznone____")) )
#set( $ScanRequest = {
"version": "2017-02-28",
"operation": "Scan",
"filter": {
"expression": "owner = :owner",
"expressionValues": {
":owner": { "S": $identityValue }
}
}
} )
$util.toJson($ScanRequest)
This template fails, because owner
is a reserved keyword. However, I can't figure out how to handle reserved words with AppSync.
How do you handle reserved words with AppSync? And is there a better way to write this Scan than my hardcoded one?