DEV Community

[Comment from a deleted post]
Collapse
 
andthensumm profile image
Matt Marks 🐣 • Edited

What makes a Lambda a Direct Resolver is when the Request and Response mapping requests are removed from the AppSync Resolver for the Lambda, not the Before and After mapping templates in the pipeline resolvers generated from the @function directive.

As shown in the image, you still have request/response mapping templates for both your lambdas. You'd need to remove those Request/Response templates and then you'd have a Direct Lambda Resolver inside a Pipeline Resolver.

Collapse
 
timmahh profile image
Tim Veletta

I was probably a bit misleading regarding the title but I feel like the additional work to remove the mapping templates to make it a true Direct Resolver is somewhat unnecessary.

From a developers point of view, they don't have to worry about touching the mapping templates which I think is the real benefit of using Amplify so in essence it feels like it is direct.

Having said that, in my personal opinion, the fact that it sets up a pipeline resolver for you out of the box is a fantastic decision since you start out thinking about how you're going to compose your functions to reuse as much logic.

 
andthensumm profile image
Matt Marks 🐣

I agree that not touching CFT is a benefit of Amplify but as mentioned in the release, the intent of Direct Lambda Resolvers is no VTL to deal with.

I think this article is great for showing how to use the @function directive though