Intro to AWS AppSync Pipeline Functions
Implementing User Authorization with AWS AppSync Pipeline Functions.
AWS AppSync executes operations on a GraphQL field using resolvers that consist of a request & a response mapping template. Many times applications require executing multiple operations (many times with multiple data sources) to resolve a single GraphQL field. In the past, this was only possible by implementing a Lambda function as the resolver which was not an ideal workflow for many use cases.
With pipeline resolvers, developers can now compose multiple operations (functions) and execute them in sequence against multiple data sources. Pipeline resolvers are useful for applications that, for instance, require performing an authorization check before fetching data for a field.
Pipeline resolvers act very similarly to a standard AppSync resolver, the only difference is we are able to encapsulate the functionality into a function that we can then plug in where needed & can also be reused.
Overview
In this tutorial, you’ll learn how to build a secure AWS AppSync API that implements user authorization by taking advantage of Pipeline Resolvers.
The access pattern we’ll be implementing will look like this:
There are two data sources: one database storing user profiles (including a…