{
"arguments" : { ... },
"source" : { ... },
"result" : { ... }, ## Only present in the response
"identity" : { ... }
}
If you are using Cognito for authentication your itentity
object will look like:
{
"sub" : "uuid", ## <- Main user UUID
"issuer" : "string",
"username" : "string"
"claims" : { ... },
"sourceIp" : "x.x.x.x",
"defaultAuthStrategy" : "string"
}
List all items
Request
{ "version" : "2017-02-28", "operation" : "Scan" }
Response
$util.toJson($ctx.result.items)
Getting sub-list of resources for a parent type
Lets say you have schema:
type List { id: ID, items: [Item] } type Item { id: ID, listId: ID, text: String }
In order to map your items to your type list, you'll do the following:
Request
{ "version" : "2017-02-28", "operation" : "Scan", "filter" : { "expression" : "listId = :listId", "expressionValues" : { ":listId" : { "S" : "${context.source.id}" } } } }
Response
$util.toJson($ctx.result.items)