Closed iparrabb closed 5 years ago
I found my mistake thanks to the issue #1079, instead of:
#set($ids = [])
#foreach($id in ${ctx.args.ids})
#set($map = {})
$util.qr($map.put("id", $util.dynamodb.toString($id)))
$util.qr($ids.add($map))
#end
{
"version" : "2018-05-29",
"operation" : "BatchDeleteItem",
"tables" : {
"DocumentTable": $util.toJson($ids)
}
}
must be:
#set($ids = [])
#foreach($id in ${ctx.args.ids})
#set($map = {})
$util.qr($map.put("id", $util.dynamodb.toString($id)))
$util.qr($ids.add($map))
#end
{
"version" : "2018-05-29",
"operation" : "BatchDeleteItem",
"tables" : {
"Document-irlvgawxhbekzpuxpzjwg4o57y-dev": $util.toJson($ids)
}
}
It is confusing :(, the TableName really is DocumentTable, at least in AppSync, but on DynamoDB the TableName is Document-irlvgawxhbekzpuxpzjwg4o57y-dev, that's how it works.
Yea the issue the resolver needing the exact name of the table listed in dynamodb, though we are looking at some ways can address this.
I tried to replicate this exact same behavior, but using the mock api. The code compiles but executing it does nothing. Is an expected behavior for local db for mocking?
@SwaySway is there a way to address having the exact table name in the batch resolver?
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels for those types of questions.
Hello everybody!
I have a problem with a custom resolver using BatchDeleteItem operation.
mutation:
resolver
request:
response:
error:
Is it my mistake or is not supported the BatchDeleteItem operation?
I can see that the actions not allow this operation:
How can support be added to this need?
Thanks!