From the course: Complete Guide to Serverless Web App Development on AWS

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Amplify GraphQL Directives

Amplify GraphQL Directives

- [Instructor] Now that our web app is ready, it's time to build a GraphQL API using AppSync. To do this, first we need to create the AppSync API in our infrastructure. To define the API, we must provide a GraphQL schema that specifies the structure of our data. There are multiple ways to define the schema in AppSync. You can write the entire schema manually and build all the result words by hand. But a more convenient approach is to use the Amplify directives. Amplify directives are annotations within your schema that provide additional information to AppSync. They also automate a lot of the boilerplate, making development much faster. Let's look at some of the most common directives that are there. First is the model directive that defines a top level object type and automatically creates the DynamoDB tables to store the data. It also generates all the necessary resolvers to connect this type to the table. In this example, a To do table will be created in DynamoDB and linked to…

Contents