Created
December 19, 2018 17:18
-
-
Save adrianhall/b62c5436588d0160077fa24b14295bd8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## Raise a GraphQL field error in case of a datasource invocation error | |
#if($ctx.error) | |
$util.error($ctx.error.message, $ctx.error.type) | |
#end | |
#set($result = {}) | |
$util.qr($result.put("totalCount", $ctx.prev.result.totalCount)) | |
$util.qr($result.put("nextToken",$ctx.prev.result.nextToken)) | |
$util.qr($result.put("items", $ctx.result.data.devRestaurantReviews)) | |
$util.toJson($result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment