Brotchu
Brotchu

Reputation: 135

Will GraphQL subscriptions push changes if the change is made not through GraphQL?

If I have a type :

type Todo {
  id: ID!
  name: String!
  desc: String!
}

and mutations to create and get list of Todo objects :
createTodo, and getListTodo
everything is good so far.
I noticed , the subscription, say :

onCreateTodo, only works as an effect of createTodo. subscription does not push new data, if I manually push a record in the DB.

is that how its supposed to work? I am using dynamodb and appsync with amplify .

Upvotes: 1

Views: 239

Answers (1)

Kisinga
Kisinga

Reputation: 1729

is that how its supposed to work?

Yes, that is how its supposed to work. But you can achieve the desired functionality by utilising the database's native subscription, referred to as streams. You should be able to emit changes to subscribers, although it would take a bit of work to get done

Upvotes: 1

Related Questions