Closed ilyador closed 5 years ago
@ilyador so basically you need Appsync to call a lambda function instead of directly going to the database. Inside your lambda function you can handle custom data and custom logic.
Check out the docs for examples of handling custom data and custom logic.
There's no need to use a lambda for this simple use case. You can simply edit your request mapping template in VTL to increment the value. See: https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-resolvers.html for more info.
Thanks for answering @amirmishani @chrisco255! @ilyador these are your choices, pick what would be the best fit your environment/project.
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.
Let's say I have an app that for some user action they increment a score by 1 point. I must make sure that the user cannot increment the value in the DB by more than 1 at a time.
Using a REST server I'd simply do that in the handling function, however I have no idea where in the AppSync pipeline is the correct place to handle such logic.