I am reading realtime data documentation but do not understandwhat is the purpose of @aws_subscribe
. Could somebody explain this in simple English? Examples about how subscriptions works with/without annotation will help a lot.
Using the @aws_subscribe directive, you can declare the mutations a subscription is subscribed to. For example:
type Mutation {
createPost(): Post
editPost(): Post
deletePost(): Post
}
type Subscription {
updatedPost(): Post
@aws_subscribe(mutations: ["createPost","editPost","deletePost"])
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With