aws cloudformation create-stack \
--stack-name AWSAppSyncTutorialForAmazonDynamoDB \
--template-url https://s3.us-west-2.amazonaws.com/awsappsync/resources/dynamodb/AmazonDynamoDBCFTemplate.yaml \
--capabilities CAPABILITY_NAMED_IAM
After running this command a AppSyncTutorial-Post table is created
Enter Model name - AWSAppSyncTutorial
Click Remove field to remove unnecessary fields
Click Create
Enter API name, such as AWSAppSyncTutorial
Click Create
Once created, select the Schema tab in the menu on the left
schema {
query: Query
mutation: Mutation
}
type Query {
getPost(id: ID): Post
}
type Mutation {
addPost(
id: ID!
author: String!
title: String!
content: String!
url: String!
): Post!
}
type Post {
id: ID!
author: String
title: String
content: String
url: String
ups: Int!
downs: Int!
version: Int!
}
PostDynamoDBTable