Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created November 29, 2018 22:48
Show Gist options
  • Save adrianhall/ed4ac5710b3a05f79a17f30b16cbabad to your computer and use it in GitHub Desktop.
Save adrianhall/ed4ac5710b3a05f79a17f30b16cbabad to your computer and use it in GitHub Desktop.
## 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("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