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()

feita há 5 anos1277 visualizações
2 Respostas
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.

respondido há 5 anos
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.

respondido há 5 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas