How to debug functions using GraphQL API
You can use the debugging process to identify errors in your functions. One of the options for debugging is using the GraphQL API.
To do so, follow the steps described on How to query GraphQL requests on Postman using the https://api.azionapi.net/events/graphql
URL.
Then, on Postman’s GraphQL request code box, add the following query, modifying the tsRange
to fit the time interval you want:
query ConsoleLog { cellsConsoleEvents( limit: 10, filter: { tsRange: {begin:"2023-02-01T10:10:10", end:"2023-06-15T10:10:10"} } orderBy: [ts_ASC] ) { ts solutionId configurationId functionId id lineSource level line }}
Send your request. You’ll receive a response similar to this:
{ "data": { "cellsConsoleEvents": [ { "ts": "2023-06-12T17:09:54Z", "solutionId": "1531300483", "configurationId": "1681964762", "functionId": "9483", "id": "fa498cd9-cbep-4382-8bbb-32b029fe7411", "lineSource": "RUNTIME", "level": "ERROR", "line": "TypeError: Object not found" }, { "ts": "2023-06-12T17:09:54Z", "solutionId": "1531300483", "configurationId": "1681964762", "functionId": "9483", "id": "fa498cd9-cbep-4382-8bbb-32b029fe7411", "lineSource": "RUNTIME", "level": "ERROR", "line": "TypeError: Object not found" }, { "ts": "2023-06-12T17:09:54Z", "solutionId": "1531300483", "configurationId": "1681964762", "functionId": "9483", "id": "fa498cd9-cbep-4382-8bbb-32b029fe7411", "lineSource": "RUNTIME", "level": "ERROR", "line": " at async mainFetch (ext:cells_fetch/26_fetch.js:266:12)" } ] }
Learn how to debug with Edge Functions and GraphQL API. Watch the video below:
Contributors