#✅ - appSync: subscription on arrays

3 messages · Page 1 of 1 (latest)

viscid harness
#

Hi,

Query ListProducts
Mutation UpdateProduct
Subscription onUpdateProducts

Schema is created automatically.
React, JS, node.js
with useState

I update one product on the list, subscribe to that update and then put the response of the subscription into the state.

After that only the updated item is displayed, the others are not part of the update.

What is the best practice to update one item in a list, subscribe to that update and in the end display the fully updated array list?

viscid harness
#

Ok, second day in research again ( as always with amplify ) : I found this article that perfectly describes the quiet disappointing solution :

https://aws.amazon.com/blogs/mobile/build-real-time-multi-user-experiences-using-graphql-on-aws-amplify/

Amazon Web Services

Today, AWS Amplify announces new real-time authorization capabilities enabling developers to build collaboration experiences with only a few lines of code. This features enables developers to share data between users by simply appending an “array” of data owners. Update to Amplify CLI version 10.3.1 and above and deploy your GraphQL API to enabl...

steady dirgeBOT
#

✅ - appSync: subscription on arrays