Component 05

GraphQL API

Connect applications to data and business logic through GraphQL.

Status

Available module

Deployment scope

Primary + DR ready

Example version constraint

~> 1.1

Review published versions ↗

What it deploys

The resources this component creates, and how they connect. Drag to pan, scroll to zoom.

Usage example

Inputs in, outputs out. Illustrative wiring, not a standalone deployment.

Supply schema.graphql, a Cognito module named auth, and AWS provider aliases required by the selected version. Add data sources and resolvers for your schema. Configure provider requirements and credentials in your root module; check the documentation for all required inputs and version changes.

main.tf
module "api" {
  source = "pomo-studio/appsync/aws"
  version = "~> 1.1"

  name                  = "my-api"
  schema                = file("${path.module}/schema.graphql")
  cognito_user_pool_arn = module.auth.user_pool_arn
  enable_xray           = true
}

Key inputs

  • name
  • schema
  • cognito_user_pool_arn
  • dynamodb_data_sources
  • enable_dr

Useful outputs

  • api_id
  • api_url
  • realtime_url
  • data_source_names

What you get

01

Managed GraphQL

Provision an AppSync API with a clear, extensible baseline.

02

Multiple data sources

Connect DynamoDB for persistence and Lambda for business logic.

03

Observable by default

Trace requests end to end with built-in X-Ray integration.

  • Materialized View

    Precompute a read-optimized projection so queries stay fast without recomputing on every request.

  • CQRS

    Separate the write model from the read model so each can be shaped for its own job.

Built with

  • AWS AppSync
  • GraphQL
  • Cognito
  • DynamoDB
  • Terraform