Im trying to update an item attribute in a DynamoDb table with AppSync. Once successful i want to use the previous value of that attribute as the key in my next call (I'm using pipeline resolvers).
To achieve this with DynamoDB you just set UPDATED_OLD as the return value.
I cannot find any documentation for specifying the return value of a DynamoDB resolver for AppSync. Ive tried the following.
{
"version" : "2018-05-29",
"operation" : "UpdateItem",
"key": {
"id": $util.dynamodb.toDynamoDBJson("foo")
},
"condition" : {
"expression" : "attribute_exists(id)"
},
"update" : {
"expression" : "SET bar = :bar",
"expressionValues" : {
":bar" : {"S" : "$bar"}
}
},
"returnValues": "UPDATED_OLD"
}
But its not valid syntax.
"message": "Unsupported element '$[returnValues]'."