Skip to content

Instantly share code, notes, and snippets.

@bboure
Created December 20, 2020 16:07
Show Gist options
  • Save bboure/a4cd25732fd89ba76662077ff5b181c3 to your computer and use it in GitHub Desktop.
Save bboure/a4cd25732fd89ba76662077ff5b181c3 to your computer and use it in GitHub Desktop.
appsync-long-cache-demo-response-template.vtl
#if($ctx.result.statusCode == 200)
#set($body = $utils.parseJson($ctx.result.body))
#foreach ($page in $body.query.pages.entrySet())
#if ($page.value.title == $ctx.args.title)
#return($page.value.extract)
#end
#end
$utils.error("Article not found", "NotFound")
#else
$utils.error($ctx.result.statusCode, "Error")
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment