Running Serverless Realtime GraphQL Applications With AppSync
Running Serverless Realtime GraphQL Applications With AppSync
About the Book
This is a book for developers, architects and technology leaders who want to learn about the latest generation of cloud technologies and how to build highly scalable, responsive web sites and APIs.
Here is what we’re going to build
- Quick domain intro
- Upollo architecture:
Appsync in five minutes
- What is AppSync?
- When to use AppSync?
- When not to use AppSync?
- Why GraphQL?
- How AppSync works with other AWS services?
CDK in five minutes
- Infrastructure as code – literally
- Why CDK?
- CDK constructs
- How CDK compares to other deployment tools
- Setting up CDK for local development
- Setting up your AWS account
- Testing the configuration
Part 1: Basic Development tasks
Your first AppSync app
- Hello World from CDK and AppSync
- Deploying an AppSync App
- AppSync application structure
- Generating API Keys
- Retrieving CloudFormation outputs with CDK
- Trying it out from the AWS console
- Trying it out from the command line
- Troubleshooting Appsync
- Accessing Data Sources from AppSync
- What are AppSync Resolvers?
- Troubleshooting deployments
- How to remove deployed applications
- Other Authentication options
- Where to find more information?
Building a simple GraphQL Schema
- Modelling GraphQl Types
- Modelling GraphqQL operations
- Verifying your schema
- VTL template basics
- Passing arguments using AppSync VTL context
- Formatting results using AppSync VTL utility functions
Testing AppSync applications
- Simulating AppSync for local tests
- Automated integration-testing with AppSync
- Securing access using IAM
- Testing API access
- Unit testing VTL templates
Part 2: Working with persistent data
Connecting AppSync to DynamoDB
- Why DynamoDB?
- Adding a database using CDK
- Accessing DynamoDB items using the web console
- Accessing DynamoDB records from the command line
Reading from DynamoDB via AppSync:
- VTL templates for DynamoDB
- Integration testing AppSync with DynamoDb
Working with Mutations
- Scope for this chapter
Saving to DynamoDB using AppSync:
Creating unique IDs in resolvers using
- Updating existing Dynamo records
- Using update conditionals to preventing accidental object creation
Single-table dynamo design
- How Dynamo tables compare to SQL tables
- Why single tables?
- Modelling relations with single-table design
- Example Upollo records
Migrating resolvers to single-table design: saving answers with
- Using Dynamo batch writes for performance
Accessing object graphs with GraphQL
- Using DynamoDB queries to list collections by prefix
- Accessing object graphs using GraphQl subitem queries
Adding answers to
Queries for lists:
- Using pipeline resolvers to customise output
Sharing VTL templates between resolvers: how to read ID from stash or args with
- Testing hierarchical resolvers
Performing complex updates
- Atomically updating Dynamo item fields
- Using DynamoDB transaction writes for consistency
Capturing timestamps using
Part 3: Working with web clients
Introduction to AWS Amplify
- Creating and deploying an Amplify App that connects to AppSync
- Running graphQL queries
- Executing GraphQl mutations
- Using the
Authenticating users with AWS Cognito
- What is Cognito?
- User pools
- Hosted UI
- Allowing Cognito access in GraphQL
- Testing Cognito access from the AWS Web console
- Integrating Cognito with Amplify Apps
- Modelling data security using GraphQl
- Restricting data reads using AppSync
- Dealing with unauthorised access on the front end
Realtime updates with GraphQl subscriptions
- How GraphQl subscriptions work?
- Declaring Subscriptions in the schema
- Triggering subscriptions with mutations
- Subscribing to updates using Amplify SDK
Part 4: Connecting to other services using AppSync Resolvers
Using AWS Lambda for custom processing
- Converting data using Lambda
- Connecting to other AWS Services (S3)
- Using Lambda logs for CloudWatch metrics
Searching using ElasticSearch/OpenSearch
- Updating ElasticSearch documents using DynamoDB streams
- Connecting to external APIs using HTTP resolvers
Processing transient data with local resolvers
- Triggering custom notifications
Part 5: Operating AppSync applications
Working with deployment pipelines
- Setting up for teamwork
- Deploying CDK apps using AWS CodePipeline
- Deploying AWS Amplify Apps
- Managing dev, test, staging and production stacks
- Configuring using SSM
Monitoring AppSync applications
- ClodudWatch logs
- CloudWatch insights
- Adding custom metrics
Setting up a custom domain
- Integrating AppSync APIs with CloudFront distributions
- Deploying to multiple regions
Part 6: Quick reference guide
- AppSync extensions
- What is VTL?
- AppSync context
- AppSync Utility functions
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.