- 최신
- 최다 투표
- 가장 많은 댓글
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)
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 일 년 전