AppSync

How I scaled an AppSync project to 200+ resolvers

I have been working on a large AppSync project for a client these past few months. The initial version of the app was built in just a few weeks, but the client has commissioned additional features and the project has kept growing. At the time of writing, this project has over 200 AppSync resolvers and …

How I scaled an AppSync project to 200+ resolvers Read More »

AppSync: how to inject table names into DynamoDB batch & transact operations

When working with CloudFormation, AWS recommends not to give explicit names to resources and let CloudFormation name them for you. This has several advantages: It’s harder for attackers to guess resource names such as S3 buckets or DynamoDB tables. You can deploy the same stack multiple times to the same account. This is useful when …

AppSync: how to inject table names into DynamoDB batch & transact operations Read More »

AppSync: how to compare strings lexicographically in VTL

I had been working on a client project where I built the GraphQL backend for a new social network using primarily AppSync, Lambda and DynamoDB. One of the features of the app was to support private messaging between two users. To allow either user to fetch their chat messages in chronological descending order, I modelled …

AppSync: how to compare strings lexicographically in VTL Read More »

AppSync: how to error on DynamoDB conditional check failures

TL;DR To make an AppSync DynamoDB resolver throw exceptions on conditional check errors, we need to check $context.error in the response mapping template ourselves. Like this: #if ( $ctx.error ) #if ( $ctx.error.type.equals(“DynamoDB:ConditionalCheckFailedException”) ) $util.error(“your error message”) #else $util.error($ctx.error.message, $ctx.error.type) #end #end $utils.toJson($context.result) And now, the longer version. The problem AppSync lets us perform DynamoDB …

AppSync: how to error on DynamoDB conditional check failures Read More »

AppSync: skipping nullable nested resolvers by returning early

Whilst working on a client project, I ran into an interesting problem with AppSync which I couldn’t find an answer after a lot of googling. I hope this article can save you the same pain should you run into the same problem. The problem is that when you have a nullable nested field that you …

AppSync: skipping nullable nested resolvers by returning early Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close