'Appsync merge two objects in resolver result mapping

In my resolver response mapping, I would like to merge $ctx.result into $ctx.source.node, similar to what would be in javascript

$ctx.result = Object.assign($ctx.source.node, $ctx.result)

How to do it here? Is this even possible?

$util.toJson($ctx.result)
// ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source