2 Answers
- Newest
- Most votes
- Most comments
0
AppSync subscriptions publish the object that is returned by the mutation (after filtering subscription selection set fields). That means that if you include the related field in the selection set of the mutations and the subscription query then you will be able to subscribe to the connected information.
E.G.
mutation {
updatePerson(input: { ... }) {
id
cities { items { id name persons { items { id } } } }
}
}
subscription {
onUpdatePerson {
id
cities { items { id name persons { items { id } } } }
}
}
answered 5 years ago
0
Thanks a lot! That explains it, and it makes sense. I'd be happy to contribute this to the Amplify docs, if that's possible. I'll see if it's open for edits.
BTW, Amplify is a fantastic service, kudos for the great work.
answered 5 years ago
Relevant content
- asked 2 years ago
- asked 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 6 months ago