DVA-C02

Introduction to AWS AppSync

Managed GraphQL and real-time APIs connected to AWS data sources.

  • 1 lesson
  • Module quiz

A screen in a modern application often needs data from several places at once, such as a user's profile, their recent orders and some recommendations. With a REST API, the client typically makes several requests and receives more fields than it displays. GraphQL is a query language for APIs that solves this: the client sends one query describing exactly the fields it needs, and the server gathers them from wherever they are stored.

AWS AppSync is a managed service for building GraphQL APIs. The developer defines a schema describing the types of data and the operations available, and connects each field to a data source, such as an Amazon DynamoDB table, a Lambda function, an Aurora database or an HTTP endpoint, through small pieces of code called resolvers. AppSync also pushes real-time updates to connected clients through subscriptions. It is charged per query and mutation operation, plus real-time messages and connection minutes.

Where AppSync fits

On the exam, the deciding word is usually GraphQL, or a requirement for real-time updates to many connected clients; both point to AppSync rather than API Gateway. AppSync supports several authorisation modes, namely API keys, IAM, Amazon Cognito user pools, OpenID Connect and Lambda authorisers, and it can cache resolver results and be protected with AWS WAF. AWS Amplify uses AppSync for the data layer of the applications it builds.

How this module is organised

The module has a single lesson, Building GraphQL APIs with AWS AppSync, which explains schemas, resolvers and data sources, real-time subscriptions, authorisation, and how to choose between AppSync and API Gateway.

  1. Building GraphQL APIs with AWS AppSync Lesson 1
  2. Practise and review
  3. Test your knowledge 4 questions