aws / aws/aws-appsync-community

Lambda error not resulting in errors object in AppSync response

Open
#82 2 comments 5 reactions 0 assignees View on GitHub
question
Dominant language
HTML
Stars
507
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I used to get the **errors** object in AppSync response and a 5xx status code - if there was an error thrown from Lambda resolver (either a timeout error or a handled error I send as the first parameter in the lambda callback)

Eg.
`callback(errorMessage, …)`

I can no longer see the errors object in AppSync – even though the Lambda resolver is throwing errors.

Is this a change in implementation or a bug?

I'm having to work around this by changing the response mapping template in AppSync resolver – to use **$util.error** based on a flag in the Lambda response.
While doing this – I'm able to get the errors object in AppSync response – but it’s still a 200 OK response.

Any way we can override this status code in AppSync?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the reported AppSync Lambda resolver behavior, including timeout errors and callback(errorMessage, …). Compare the response mapping template workaround using $util.error with the observed errors object and HTTP status. Done means establishing whether this is an implementation change or bug and whether AppSync supports overriding the 200 status code.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.