In this step we will retrieve the data in the DynamoDB table with the key passed in.
{
"version" : "2017-02-28",
"operation" : "GetItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($ctx.args.id)
}
}
$utils.toJson($context.result)
query getPost {
getPost(id:123) {
id
author
title
content
url
ups
downs
version
}
}
{
"data": {
"getPost": {
"id": "123",
"author": "AUTHORNAME",
"title": "Our first post!",
"content": "This is our first post.",
"url": "https://aws.amazon.com/appsync/",
"ups": 1,
"downs": 0,
"version": 1
}
}
}