Architecture > API Architecture
GraphQL Requests
Learn about the necessary cloud infrastructure resources on which the API project application relies on to perform graphql requests.
- how GraphQL HTTP requests are handled by the deployed cloud infrastructure and application code
Diagram
For brevity, the diagram doesn’t include network-level cloud infrastructure resources, like region, VPC, availability zones, and so on. Check out the Deployment Modes section if you’re interested in that aspect of the deployed cloud infrastructure.
Note that the stateful resources like Amazon S3, Amazon Cognito, Amazon DynamoDB and Amazon ElasticSearch are deployed as part of the Core project application. These are still included in the diagram, just so it’s more clear to the reader.
Description
The diagram shows how HTTP requests (GraphQL queries and mutations) travel through the deployed cloud infrastructure. Request are primarily issued by the Admin Area, or Website applications, but of course, can be issued by other clients as well.
The flow consists of the following six steps:
- The GraphQL HTTP request first reaches the Amazon CloudFront
A . - The request is forwarded to the Amazon API Gateway
B . - The Amazon API Gateway invokes the GraphQL Handler AWS Lambda function
C . - Depending on the issued GraphQL operation, the AWS Lambda function’s code may issue one or more requests to other cloud infrastructure resources:
- Amazon Cognito
E to perform identity authentication - Amazon DynamoDB
F or Amazon ElasticSearch ServiceG to perform database queries
- Amazon Cognito
- Once the code execution has completed, an HTTP response is returned back to the Amazon API Gateway
B . - The Amazon API Gateway
B forwards the request to the Amazon CloudFrontA , which again forwards it back to the client.