Closed jaimeardp closed 1 month ago
Hi @jaimeardp in order to implement an atomic counter with Amplify Gen 2, I would recommend adding a custom mutation to your schema and execute the DynamoDB operation in an AppSync JS resolver.
Please refer to our docs on custom operations and let us know if you run into any issues along the way: https://docs.amplify.aws/react/build-a-backend/data/custom-business-logic/
Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you.
Thank you!
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Amplify CLI Version
10.8.1
Question
Environment information
Actually, searching in documentation, I found a simple example of update, just only "replace" old value by new value.
But my use case is a increment, because i need to update column like views or counter in post. I understand that i can first to use "client.models.Blog.get" and after to use "client.models.Blog.update". But then is needed to perfom both requests for to update one simple "Atomic counters" in DynamoDB ?
Please if you face use case, recommend me, thanks.
I hope this in amplify gen2 data client.
json file