I’m getting the below response in AWS Appsync console, when i try to invoke graphql API.
Request failed with status code 400
Query:
query MyQuery {
getUserData(inputArguments: $inputArguments) {
__typename
}
}
Variables:
{
"inputArguments": {
}
}
I’m unable to debug it as Lambda is not being invoked.
1 Answer
This is very likely caused by insufficient rights. Does Appsync have the rights to call the Lambda function?
Somawhat similar problem discussed here
https://github.com/aws/aws-cdk/issues/19239
Excerpt code from the linked issue that was the solution. It grants appsync.amazonaws.com rights to call the ‘authorizerLambda’ lambda:
authorizerLambda.addPermission("appsync", {
principal: new ServicePrincipal('appsync.amazonaws.com'),
action: 'lambda:InvokeFunction',
})
New contributor