Skip to content

Instantly share code, notes, and snippets.

@yai333
Created March 27, 2019 05:10
Show Gist options
  • Select an option

  • Save yai333/c8c3353e02b31c57facb024a2e7420ed to your computer and use it in GitHub Desktop.

Select an option

Save yai333/c8c3353e02b31c57facb024a2e7420ed to your computer and use it in GitHub Desktop.
input PostInput {
title: String
content: String
notificationEmails: String
createdAt: String
}
type Mutation {
addPost(post: PostInput!): Post
deletePost(id: Int!): Post
}
type Post {
id: Int
title: String
datetime: String
author: String
content: String
createdAt: String
notificationEmails: String
}
type Query {
getPosts(limit: Int, currentPage: Int, nextPage: Int): [Post]
}
type Subscription {
onPostAdded: Post @aws_subscribe(mutations: ["addPost"])
onPostDeleted: Post @aws_subscribe(mutations: ["deletePost"])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment