Unifying Microservice GraphQL with AWS AppSync Merged API - Distributed Team Development in Practice
This article explains how to merge GraphQL APIs that multiple teams develop / deploy independently into a single endpoint. It also introduces ways to avoid schema conflicts and how to design an authentication strategy.
Why Merged API Is Needed
When multiple teams develop GraphQL APIs in a microservices architecture, the frontend needs to send requests to multiple endpoints, which increases complexity on the client side. Merged API addresses this problem by merging multiple source APIs into a single endpoint. The user team's User API, the order team's Order API, and the product team's Product API can each be developed / deployed independently, while the frontend accesses them through one GraphQL endpoint. Unlike REST-based API aggregation such as API Gateway, the integration happens at the GraphQL schema level, so cross-service queries can also be run in a single request.
Source API Design and Independent Deployment
Each team develops an independent AppSync API as a source API. Schemas, resolvers, and data sources are managed per source API, and each team can deploy / update its own API independently. Source API updates are reflected in the Merged API if auto-merge is configured, and with manual merge, the owner of the source API runs the merge. Schema conflicts (Query fields with the same name, type definitions with the same name) are detected at merge time and reported as errors. To avoid conflicts, one design is for teams to agree on schema naming conventions in advance and use namespace-like prefixes (user_, order_), or to manage common type definitions as a shared schema.
Authentication Strategy
You set the default authentication method (Cognito user pools, IAM, API keys, Lambda authorizers) at the Merged API level. You can configure additional authentication methods for each source API and apply source API authentication to specific fields. For example, a configuration is possible in which the default authentication of the Merged API is set to Cognito, while IAM authentication is added at the source API level for Mutations intended for administrators. You control field-level authentication with the @aws_auth directive, and you can expose specific fields only to specific Cognito groups.
Merged API Pricing and Limitations
Merged API pricing is the same as for regular AppSync APIs, and queries / mutations cost approximately $4.00 per million requests (as of August 2026). There is no additional charge for the Merged API itself, but there is a limit on the number of source APIs (default 10), and large microservice environments need to request a limit increase. When a source API resolver calls Lambda, the Lambda charges are billed to the account of the source API. When you enable caching for the Merged API, query results that span source APIs are cached, which lets you reduce the number of backend calls.
Real-Time Updates and Subscriptions
One GraphQL feature is real-time data updates through subscriptions. In a Merged API as well, the subscriptions defined by each source API are merged, and the frontend can subscribe to update notifications from multiple services through a single endpoint. Because the server pushes changes over WebSocket, you can use this for purposes such as chat, notifications, and live dashboard updates. Clients can handle real-time features that each team defined independently through the same endpoint.
Monitoring and Observability
When operating a merged API, you check which resolver of which source API is slow. You record the execution status of requests and resolvers in CloudWatch logs, and you visualize how requests passed through source APIs and backends with X-Ray distributed tracing. This lets you identify latency bottlenecks and where errors occur. If you make it possible to trace resolution status at the field level, it becomes easier to isolate the cause of a specific query being heavy. Because code from multiple teams is involved, you set up a mechanism that lets you observe across teams.
CI/CD and Schema Management
Because each team deploys independently, you prepare a mechanism that keeps the schema consistent. You build changes to source APIs into the CI/CD pipeline and automatically detect schema conflicts at merge time so that breaking changes do not flow into production. Teams agree on naming conventions and prefixes, and shared types are managed as common definitions. If you operate so that changes are applied after passing contract tests, so as not to break the fields that clients depend on, you can maintain a stable endpoint even in distributed development. Version-controlling the schema as code supports tracking changes and evolving safely.
Caching and Performance Optimization
Queries that span multiple source APIs tend to increase calls to the backend. When you enable caching for the Merged API, responses to queries that frequently return the same results are kept for a certain period of time, which lets you reduce backend load and latency. In resolver design, watch out for the N+1 problem, in which related data is retrieved one item at a time and calls multiply, and improve efficiency with batch processing that retrieves the data together. You can maintain overall performance by designing each source API to return data efficiently within its own scope of responsibility and preventing excessive refetching in the integration layer.
Summary
AppSync Merged API is a service that merges the GraphQL APIs of multiple teams into a single endpoint. It provides the frontend with a simple single endpoint while keeping each team's deployments independent. It is one of the patterns for adopting GraphQL in a microservices architecture.
References (Official AWS Resources)
The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.
- AWS AppSync official page
- Amazon Cognito official page
- AWS Lambda official page
- AWS Documentation (official)
If this page and the official documentation disagree, treat the official documentation as authoritative.