You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Following the example here: https://docs.amplify.aws/cli/graphql-transformer/function I created a lambda resolver for one of my GraphQL queries. If I make an GraphQL query and my lambda function throws an error, it does not propagate to GraphQL. Instead, it just returns an empty response.
Amplify CLI Version
4.37.1
To Reproduce
Generate a lambda resolver: amplify add function
Add the @function directive to a GraphQL field
In the lambda resolver, use this code for an example:
Run amplify mock
If I just return some normal data, everything works fine, but as soon as I throw an error, my response is empty (GraphQL usually complains about missing fields at this point, because some of my fields are mandatory, and I'm not filling them out)
Expected behavior
Looking at the generated InvokeFooDataSource.res.vtl resolver mapping template, I see the following code:
Describe the bug
Following the example here: https://docs.amplify.aws/cli/graphql-transformer/function I created a lambda resolver for one of my GraphQL queries. If I make an GraphQL query and my lambda function throws an error, it does not propagate to GraphQL. Instead, it just returns an empty response.
Amplify CLI Version
4.37.1
To Reproduce
amplify add function
@function
directive to a GraphQL fieldamplify mock
If I just return some normal data, everything works fine, but as soon as I throw an error, my response is empty (GraphQL usually complains about missing fields at this point, because some of my fields are mandatory, and I'm not filling them out)
Expected behavior
Looking at the generated
InvokeFooDataSource.res.vtl
resolver mapping template, I see the following code:I would expect
$ctx.error
to contain my error object, but it is always empty.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: