question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Resolver - Unsupported operation 'BatchDeleteItem'/'BatchPutItem'

See original GitHub issue

Hi,

I’ve written a custom resolver with BatchPutItemand BatchDeleteItem. Everytime I run a mutation with this resolver I get

{
  "data": {
    "batchDeleteBusinessList": null
  },
  "errors": [
    {
      "path": [
        "batchDeleteBusinessList"
      ],
      "data": null,
      "errorType": "MappingTemplate",
      "errorInfo": null,
      "locations": [
        {
          "line": 38,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "Unsupported operation 'BatchDeleteItem'."
    }
  ]
}

or "message": "Unsupported operation 'BatchPutItem'."

  • req
#set($ids = [])
#foreach($id in ${ctx.args.input})
    #set($pkey = {})
    $util.qr($pkey.put("id", $util.dynamodb.toString($id)))
    $util.qr($ids.add($pkey))
#end
{
  "version": "2018-05-29",
  "operation": "BatchDeleteItem",
  "tables": {
      "BusinessList-dzqohgcrhvhptkhcfvrvlkxdsy-dev": $utils.toJson($ids)
  }
}
  • Mutation.batchDelete.res.vtl.
#if ($ctx.error)
    $util.appendError($ctx.error.message, $ctx.error.type)
#end
$util.toJson($ctx.result.data["BusinessList-dzqohgcrhvhptkhcfvrvlkxdsy-dev"])
  • Mutation.batchDelete.res.vtl
  batchDeleteBusinessList(input: [
    "c279aa14-0f68-4a26-a18f-bb854cb185c9",
    "8465e9f1-765c-43a6-9b19-a6b73b7fb762"
  ]) {
    id
  }

Any ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SwaySwaycommented, Apr 9, 2020

You can check if this is enabled by checking your transformer.conf.json if it contains a ResolverConfig set up. I was able to get this working on a project that does not have conflict detection enabled and I was able to reproduce this issue on a project with this enabled.

To clarify why this might be related is because using Batch Operations with Conflict Detection is not supported. Read more here: https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html

Should conflict detection not be enabled and you are still running into this Unsupported Operation Issue please comment below.

0reactions
github-actions[bot]commented, May 26, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Amplify Custom Resolver - Unsupported operation ...
I'm following some guides to implement a custom resolver with BatchPutItem operation. Currently I'm facing some issues which I can't get ...
Read more >
How to Fix the Unsupported Operation Exception in Java
UnsupportedOperationException is a Java runtime exception that occurs when an unsupported operation is requested but could not be performed.
Read more >
Java List UnsupportedOperationException | Baeldung
UnsupportedOperationException. A frequent way in which this error occurs is when we use asList() method from java.util.Arrays: public static ...
Read more >
API (GraphQL) - Overwrite & customize resolvers - Amplify Docs
Resolvers are the mechanism by which requests are fulfilled. Learn how to overwrite or add custom resolvers with Amplify. - AWS Amplify Docs....
Read more >
Unsupported Operation Exception when Starting WebSphere ...
ConfigServiceImpl.resolve(ConfigServiceImpl.java:837) at com.ibm.bcg.server.admin.EnvironmentUtility.initialize(EnvironmentUtility.java:99) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found