Appsync ^new^ -

type Subscription onCreatePost: Post @aws_subscribe(mutations: ["createPost"])

type Mutation createPost(title: String!, content: String): Post appsync

// JavaScript resolver for createPost export function request(ctx) return operation: "PutItem", key: id: Util.autoId() , attributeValues: title: ctx.args.title, content: ctx.args.content ; key: id: Util.autoId()

type Query getPost(id: ID!): Post