In AWS AppSync VTL resolvers how to change a value before writing it to the datasource?

In AWS AppSync VTL resolvers how to change a value before writing it to the datasource?


0

With this req template I can send the event to a lambda where I can check and edit some user input fields:

{
  "version": "2018-05-29",
  "operation": "Invoke",
  "payload": {
      "typeName": "$ctx.stash.get("typeName")",
      "fieldName": "$ctx.stash.get("fieldName")",
      "arguments": $util.toJson($ctx.arguments),
      "identity": $util.toJson($ctx.identity),
      "source": $util.toJson($ctx.source),
      "request": $util.toJson($ctx.request),
      "prev": $util.toJson($ctx.prev)
  }
}

My lambda is correctly triggered.

I’m not sure what my lambda needs to return and how the res template should be.

Hints?


Load 5 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *