Last active
March 13, 2020 00:34
-
-
Save claym/4d58914486d8bbfa6c5e523b6ff18e42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query: | |
query getEvent { | |
listEventInstances (filter: {date: {eq: "2020-03-11"}}){ | |
items{ | |
id | |
date | |
} | |
} | |
} | |
resolver: | |
#set( $limit = $util.defaultIfNull($context.args.limit, 10) ) | |
#set( $ListRequest = { | |
"version": "2017-02-28", | |
"limit": $limit | |
} ) | |
#if( $context.args.nextToken ) | |
#set( $ListRequest.nextToken = $context.args.nextToken ) | |
#end | |
#if( $context.args.filter ) | |
#set( $ListRequest.filter = $util.parseJson("$util.transform.toDynamoDBFilterExpression($ctx.args.filter)") ) | |
#end | |
#if( !$util.isNull($modelQueryExpression) | |
&& !$util.isNullOrEmpty($modelQueryExpression.expression) ) | |
$util.qr($ListRequest.put("operation", "Query")) | |
$util.qr($ListRequest.put("query", $modelQueryExpression)) | |
#if( !$util.isNull($ctx.args.sortDirection) && $ctx.args.sortDirection == "DESC" ) | |
#set( $ListRequest.scanIndexForward = false ) | |
#else | |
#set( $ListRequest.scanIndexForward = true ) | |
#end | |
#else | |
$util.qr($ListRequest.put("operation", "Scan")) | |
#end | |
$util.toJson($ListRequest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment