Type: AWS::AppSync::Resolver
Properties:
  ApiId: !GetAtt AppSyncAPI.ApiId
  DataSourceName: !GetAtt AppSyncDynamoDBMechanismSource.Name
  TypeName: "Query"
  FieldName: "getMechanism"
  RequestMappingTemplate: |
    {
      "version": "2018-05-29",
      "operation": "GetItem",
      "key": {
        "owner": { "S": $util.toJson($util.defaultIfNull($ctx.args.owner, $ctx.identity.sub)) },
        "sort": $util.dynamodb.toDynamoDBJson($ctx.args.id)
      }
    }
  ResponseMappingTemplate: |
    #if( $ctx.error )
      $util.error($ctx.error.message, $ctx.error.type)
    #else
      $util.toJson($ctx.result)
    #end