Debugging a Lambda Query where I have a bug in my script. GraphQL gives me the standard error:
Evaluation of custom field failed because external request returned an error: unexpected error with: 500 for field: relativeContacts within type: Query.
Which is not much information to go on, so I turn to the Slash Lambda Logs. I refresh to pull the latest logs and do this several times while running the query through GraphQL. I scroll to the bottom of the logs output and I see a message:
2020-12-28 18:50:36.82360834 +0000 UTC Server Listening on port 8686!
After running several times I am still getting the same last output after several minutes. I am using console.log in my script which should be generating output.
It is then that I realize that the output is not ordered correctly. If I scroll up the log output I see output:
2020-12-28 18:41:58.51093455 +0000 UTC Server Listening on port 8686!
Which would appear in the correct order, but if I scroll even further up the logs I see:
2020-12-28 18:54:36.935147327 +0000 UTC TypeError: Cannot read property 'state' of undefined
Which is the error I was looking for, but logically the log output is out of order causing me some lost time.