Hey folks. Thanks for sharing this. So many good bits, especially on resolver mapping.
I can't get the optional resolver to resolve.
Using the suggested mapping:
{
"version": "2017-02-28",
"operation": "Query",
"index":"state-index",
"query":{
"expression":"#state = :state",
"expressionNames":{
"#state":"state"
},
"expressionValues":{
":state" :{
"S": $util.dynamodb.toDynamoDBJson($ctx.args.state),
}
}
}
}
with this default request mapping template:
## Pass back the result from DynamoDB. **
$util.toJson($ctx.result.items)
query GetByState {
getDestinationsByState(state:"Florida"){
id
description
}
}

{
"data": {
"getDestinationsByState": null
},
"errors": [
{
"path": [
"getDestinationsByState"
],
"data": null,
"errorType": "MappingTemplate",
"errorInfo": null,
"locations": [
{
"line": 14,
"column": 3,
"sourceName": null
}
],
"message": "Value for field '$[query][expressionValues][:state][S]' must be text."
}
]
}
{
"version": "2017-02-28",
"operation": "Query",
"index": "todoid-index",
"query": {
"expression": "todoid = :todoid",
"expressionValues": {
":todoid": {
"S": "$context.source.id"
}
}
}
}
I'm thinking the solution is to create an index called state-index. We can only create a secondary index when we create the dynamodb table. What would you suggest is the best way to go about setting up the optional query?
Thanks.
Hey folks. Thanks for sharing this. So many good bits, especially on resolver mapping.
I can't get the optional resolver to resolve.
Using the suggested mapping:
with this default request mapping template:
{ "data": { "getDestinationsByState": null }, "errors": [ { "path": [ "getDestinationsByState" ], "data": null, "errorType": "MappingTemplate", "errorInfo": null, "locations": [ { "line": 14, "column": 3, "sourceName": null } ], "message": "Value for field '$[query][expressionValues][:state][S]' must be text." } ] }I'm thinking the solution is to create an index called
state-index. We can only create a secondary index when we create the dynamodb table. What would you suggest is the best way to go about setting up the optional query?Thanks.