Validate user input in AppSync DynamoDB Resolvers

I can’t find a nice way of doing this in GraphQL, but you can do it easily in VTL using either $util.validate or $util.error (see the AWS documentation). They both have the same result of adding an item to the errors array.

Here’s a demo of $util.validate:

Here’s a demo of $util.error:

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top