At the core of most applications is the data / API layer. This layer could look like many things. In the serverless world, this usually will be composed of a combination of an API endpoint and a serverless function. This serverless function could be doing some logic and returning data, interacting with a database of some kind, or even interacting with another API endpoint.
With Amplify there are 2 main ways of creating APIs:
A combination of Amazon API Gateway and a Lambda function
A GraphQL API connected to some type of data source (database, Lambda function, or HTTP endpoint)
API Gateway is an AWS service that allows you to create API endpoints and route them to different services, usually a Lambda function. In this chapter, you’ll learn how to create a Lambda function as well as an API Gateway endpoint and connect the two. When you make an API call, it will route the request through API Gateway, invoke the function, and return the response.
Once your API is created you then need a way to interact with it. Using the Amplify client you will be able to send requests to the endpoint using the Amplify
API class. The
API class allows you to interact with both GraphQL APIs as well as API Gateway endpoints.
In this chapter, you’ll create your first full stack serverless app that will interact with a serverless ...