1 Answer
- Newest
- Most votes
- Most comments
0
I was able to get it to work by setting the value of $ctx.result.items to $publicRecords
The issue was caused by the structure of the result output. Do note that this response template is one of the example templates in the AppSync resolver UI, so it should probably be corrected.
#set($publicRecords = [])
#foreach($item in $ctx.result.items)
#if($item.public == true)
#set($added = $publicRecords.add($item))
#end
#end
#set($ctx.result.items = $publicRecords)
$utils.toJson($ctx.result)
Edited by: raz92 on Jun 26, 2019 4:42 PM
answered 5 years ago
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago