Infrastructure > API
Overview
Cloud infrastructure resources that power Webiny's GraphQL API.
- What cloud resources the API application deploys
- How different Webiny applications use API infrastructure
Overview
The API application is your project’s GraphQL API, used by the Admin application. It consists of multiple AWS Lambda functions handling GraphQL requests, file operations, background tasks, and more.
Diagram
For brevity, the diagram doesn’t include network-level resources like VPC and availability zones. See Deployment Modes for those details.
Stateful resources like S3, Cognito, DynamoDB, and OpenSearch are shown for clarity but are deployed as part of Core Infrastructure.
Webiny Cloud Infrastructure - APIAPI Resources
Amazon API Gateway
HTTP API that routes requests to Lambda functions. Handles GraphQL operations, file uploads/downloads, and other API endpoints.
AWS Lambda Functions
- GraphQL Handler - Processes GraphQL queries and mutations
- File Upload/Download - Handles file operations and image optimization
- Background Tasks - Executes long-running jobs
- Import/Export - Manages bulk data operations
AWS Step Functions
Orchestrates background task execution. Step Functions coordinate multi-step workflows and long-running processes.
How Applications Use API Infrastructure
Security
Integrates with Amazon Cognito for authentication. Extends the GraphQL schema with user management, roles, and permissions. Stores data in DynamoDB.
Headless CMS
Extends GraphQL schema with content models. Stores content in DynamoDB and uses OpenSearch for advanced search and filtering.
File Manager
Adds dedicated Lambda functions for file upload, download, and image optimization. Stores files in S3 and metadata in DynamoDB.
Background Tasks
Uses Step Functions and Lambda to execute long-running jobs. Triggered via EventBridge events. Perfect for data imports, exports, and batch operations. See the Background Tasks section for details.
FAQ
Why Lambda Instead of AWS AppSync?
Using Lambda for the GraphQL handler provides:
- Customization - Full control over request/response handling
- Testing - Easy unit testing with standard JavaScript tools
- Flexibility - Applications can modify schema based on context (locale, tenant, etc.)
- Portability - Easier to support multiple cloud providers in the future
Which GraphQL Implementation?
Webiny uses GraphQL Tools for its lightweight approach and ease of implementation.
Which API Gateway Type?
By default, Webiny deploys HTTP APIs for better performance and lower cost.