AppSync DynamoDB atomic append to existing list attribute and other list operations

0 votes

We have an object in dynamoDB with the key id and the data below in JSON format:

We are creating, getting, and updating into this table through our frontend application using Amplify API connection to AppSync.

Currently when we want to add items to our objects list, we overwrite the entire thing, but I know that it is possible to append new items to the existing data atomically.

My extra question is if append is supported, are other list operations supported for example splice and how do we implement it? Do we need to change the query on client side, or appsync resolver / graphql schema?

Currenly I am updating my data by overwriting with a fresh copy every time using this command on the client side:

import { API } from "aws-amplify"; import { ... updateTable, ... } from "../graphql/mutations"; API.graphql({ query: updateTable, variables: variables })

Here is the data structure in dynamo DB

{ "id": "something", "objects": [ [ { "foo": [ "first", "second" ], "start": 0, "end": 20 }, { "bar": [ "third", "fourth" ], "start":10, "end": 40 }, ] ], }


 

Apr 29, 2022 in AWS by Rahul
• 9,680 points

edited 4 days ago 5 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP