TransWikia.com

What is the purpose of @aws_subscribe annotation?

Stack Overflow Asked on December 22, 2021

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.

One Answer

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"])
}

Answered by Rick Foxcroft on December 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP