JSON request sent from appSync to AWS lambda on mutation When we create a mutation request from appsynch to lambda resolver below JSON structure is passed as a event to lambda.
Could you please suggest best way to capture the event in lambda resolver?
{
"arguments": { "input" :
{
"id"=null,
"username": "MyName",
"signIn": 0
"active": true
"typeId": 2
"categoryTypeId": 3
"isPossessable": true
}
},
"identity": null,
"source": null,
"request": {
"headers": {
"x-forwarded-for": "103.123.78.9, 130.176.188.205",
"sec-ch-ua-mobile": "?0",
"dnt": "1",
"cloudfront-viewer-country": "IN",
"cloudfront-is-tablet-viewer": "false",
"x-amzn-requestid": "5a2fb939-8748-40bc-b6eb-066d1b251b37",
"via": "2.0 c5b17f7826bdac466315a86f2007a1cc.cloudfront.net (CloudFront)",
"cloudfront-forwarded-proto": "https",
"origin": "https://us-east-1.console.aws.amazon.com",
"content-length": "106",
"x-forwarded-proto": "https",
"accept-language": "en-US,en;q=0.9",
"host": "7z2ujz3rbjafvoonhy5jtx5dra.appsync-api.us-east-1.amazonaws.com",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
"cloudfront-is-mobile-viewer": "false",
"accept": "application/json, text/plain, /",
"cloudfront-is-smarttv-viewer": "false",
"accept-encoding": "gzip, deflate, br",
"referer": "https://us-east-1.console.aws.amazon.com/",
"x-api-key": "dg2-7nb73kk32be73hp4dmzvbyxz2ly",
"content-type": "application/json",
"sec-fetch-mode": "cors",
"x-amzn-trace-id": "Root=1-62c27925-1abc0a56302093e2764b22e0",
"x-amz-cf-id": "U3xaPlw75M4UNVoHvPXgu_5Wfdje6QlQTD6dIcyyA3rh4x8ypZSViA==",
"sec-fetch-dest": "empty",
"x-amz-user-agent": "AWS-Console-AppSync/",
"sec-ch-ua-platform": "\"Windows\"",
"cloudfront-is-desktop-viewer": "true",
"sec-fetch-site": "cross-site",
"sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"",
"x-forwarded-port": "443"
},
"domainName": null
},
"prev": null,
"info": {
"selectionSetList": [
],
"selectionSetGraphQL": "{}",
"fieldName": "createUser",
"parentTypeName": "Mutation",
"variables": {}
},
"stash": {}
}