I am building grpahql on Appsync and use websocket as subscription communication channel. Below is the scheme:
type Subscription {
addedPost: Post
@aws_subscribe(mutations: ["addPost"])
updatedPost: Post
@aws_subscribe(mutations: ["updatePost"])
deletedPost: Post
@aws_subscribe(mutations: ["deletePost"])
}
and I will attach lambda as the resolver for these subscription fields. In the schema, each subscription fields returns Post
as response type. In my lambda resolver, what should I return? In the lambda, it doesn't know anything about Post
because Post
is used in the mutation
. I don't understand what I should return in the subscription resolver lambdas.