- Newest
- Most votes
- Most comments
I've determined the cause of the error. The Pipeline Resolver 'Before mapping template' and 'After mapping template' were empty! They were being created from over-ride files in the project which were set as empty files (or rather, just comments).
The fix, of course, if to set the 'before template' to {} and the 'After template' to $util.toJson($ctx.result)
Can you provide graphQlApiId and timestamp so that we can do further investigation?
Hello I am facing the same error even though I have set {} in Before Mapping Template.
Before Mapping Template:
{}
Function Request Mapping Template:
#set( $attribs = $util.dynamodb.toMapValues($context.args.input) )
{
"operation" : "PutItem",
"key" : {
## If object "id" should come from GraphQL arguments, change to $util.dynamodb.toDynamoDBJson($ctx.args.id)
"id": $util.dynamodb.toDynamoDBJson($util.autoId()),
},
"attributeValues" : $util.dynamodb.toMapValuesJson($attribs)
}
Function Response Mapping Template:
#if($ctx.error)
$util.error($ctx.error.message, $ctx.error.type)
#end
Pass back the result from DynamoDB. **
$util.toJson($ctx.result)
After Mapping Template:
$util.toJson($ctx)
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago