how to log inside of response template?

0

I have a pipeline response template and inside the "After Mapping" section I want to output to cloud watch a parameters value so I can debug what is going on with the resolver. I am basically looking for a vtl version of console.log()

已提問 5 年前檢視次數 1277 次
2 個答案
0

I found a sloppy way of doing it via

$util.validate(false, $record.entity )

This will generate an error in graphql, but it can show what the value was of a variable.

已回答 5 年前
0

You can also just stash the value and it will show up in the logs, depending on your settings.

$util.qr($ctx.stash.put("debugthis", $record.entity))

Also note that your log level in AppSync must be set to ALL if you want to see this output.

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南