2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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 } } } }
}
}
답변함 5년 전
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.
답변함 5년 전