Chapter 3. Creating Your First App
In Chapter 2, you created a basic API layer using a combination of API Gateway and serverless functions. This combination is very powerful, but you have not yet interacted with a real database.
In this chapter, you will be creating a GraphQL API that interacts with a DynamoDB NoSQL database to perform CRUD+L (create, read, update, delete, and list) operations. You’ll learn what GraphQL is, why developers are adopting it, and how it works.
We will be building a notes app that will allow users to create, update, and delete notes. It will also have GraphQL subscriptions enabled in order to see updates in real time. If another user is interacting with the app and they create a new note, our app will update with the new values in real time.
Introduction to GraphQL
GraphQL is an API implementation that is an alternative to REST. Let’s have a look at what GraphQL is, what a GraphQL API consists of, and how GraphQL works.
What Is GraphQL?
GraphQL is an API specification. It is a query language for APIs and a runtime for fulfilling those queries with your data. It is, and can be used as, a replacement for REST and has some similarities to REST.
GraphQL was introduced by Facebook in 2015, though it had been used internally since 2012. GraphQL allows clients to define the structure of the data that is required from an API call so that they can know exactly what data structure is going to be returned from the server. Requesting data in this way enables ...
Get Full Stack Serverless now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.