So what are some of the categories that we enable right now? Well, within each of these categories, there's typically a couple of different services. So for instance, for API, you can create a REST API, a couple of different types of those, or a GraphQL API. So we support all of these different features, but we're really gonna be focusing mainly on GraphQL today.
And the GraphQL Transform library is part of some of the tooling that the CLI gives you. And what exactly is the GraphQL Transform library? Let's first kind of take a look at that before we dive into some of the more, the deeper understandings of what exactly this library does. So let's talk about building a GraphQL API from scratch. What would you need to make this happen? So let's say you needed a to-do app and you needed a way to create, update, and delete to-dos. You would first start off with your GraphQL schema and the schema might have a to-do type. You would then create, update, and delete mutations. You might also have a query for getting a to-do and listing all of the to-dos. And then you might have subscriptions that you would create for on create, on update, and on delete to-do. So you would need to create all that schema. You would then need to have some type of database or data source that would interact with your GraphQL API. And then you would need to create the resolvers that map between the schema with the GraphQL operations and the data sources.
So putting all this together is quite a bit of work, but on top of that, you have to think about stuff like authorization, authentication, security, anything that may be vulnerable as far as a GraphQL API is concerned, things like nested queries and things like that. So when you're building an API, you not only are thinking about your infrastructure, but you're also thinking about the maintenance and all of this additional code that you're dealing with. So services like AWS AppSync, which is a managed GraphQL service kind of make this easier. And that's essentially what powers the GraphQL transform library under the hood. So using these directives, we can take the managed GraphQL service that is AppSync, use our local GraphQL schema with Amplify and add a bunch of different new pieces of configuration, but also different features and stuff just by using these directives.
So here's some of the ones that we enable right now, and the ones we're gonna be diving into on this talk are gonna be at model, at auth and at connection. And we're gonna look exactly like what are those doing. So when you're working with the GraphQL transform library, like how does this actually work? Well, just think of a typical GraphQL schema. You just write all of the schema definition that you would need. With the GraphQL transform library, you would then decorate your base types with these different directives. And then you run a build. And then after you run that build, we generate infrastructure as code. And then when you run the deployment, we deploy that infrastructure for you based on those directives.
So let's look in a little more depth at some of these directives. So at model is really one of the most powerful ones. And this directive scaffolds out databases, resolvers and CRUD operations and subscriptions really for any base type.
Comments