Structuring a GraphQL API (blank or imported APIs) - Amazon AppSync
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Structuring a GraphQL API (blank or imported APIs)

Before you create your GraphQL API from a blank template, it would help to review the concepts surrounding GraphQL. There are three fundamental components of a GraphQL API:

  1. The schema is the file containing the shape and definition of your data. When a request is made by a client to your GraphQL service, the data returned will follow the specification of the schema. For more information, see Schemas.

  2. The data source is attached to your schema. When a request is made, this is where the data is retrieved and modified. For more information, see Data sources.

  3. The resolver sits between the schema and the data source. When a request is made, the resolver performs the operation on the data from the source, then returns the result as a response. For more information, see Resolvers.

Amazon AppSync manages your APIs by allowing you to create, edit, and store the code for your schemas and resolvers. Your data sources will come from external repositories such as databases, DynamoDB tables, and Lambda functions. If you're using an Amazon service to store your data or are planning on doing so, Amazon AppSync provides a near-seamless experience when associating data from your Amazon accounts to your GraphQL APIs.

In the next section, you will learn how to create each of these components using the Amazon AppSync service.