Frequently Asked Questions

Federation Approaches: Schema Stitching, GraphQL Federation, and Content Federation

What is schema stitching in GraphQL, and when should it be used?

Schema stitching is a technique for combining multiple GraphQL schemas from different services into a single endpoint using a gateway. The gateway imports individual schemas, stitches them together, and exposes a unified API to clients. Schema stitching is best suited for scenarios where services are already built independently and need to be combined under one endpoint, especially when there are few shared types. The learning curve is low, but as the number of microservices and shared types grows, maintaining the gateway can become complex. Note: For large-scale systems with many shared types, schema stitching may not be optimal; consider GraphQL Federation instead. (Source: Hygraph Blog)

How does GraphQL Federation differ from schema stitching?

GraphQL Federation, such as Apollo Federation, also enables combining multiple GraphQL services under a single endpoint but is designed for large-scale, distributed systems. It uses the concepts of subgraphs and a router that automatically composes a supergraph from subgraphs, enforcing the separation of concerns principle. Each subgraph is responsible for its own types and fields, and shared types (entities) can be extended across subgraphs. Federation is ideal for systems designed from scratch that require scalability, maintainability, and independent development. The learning curve is higher than schema stitching due to the need to understand federation concepts and schema design. Note: Federation requires careful schema design and is more complex to implement initially. (Source: Hygraph Blog)

What is content federation, and how does it relate to CMS platforms like Hygraph?

Content federation is the process of integrating data from multiple remote sources and backends via API into a CMS platform, without migrating or duplicating the data. In Hygraph, content federation is enabled through the Remote Sources feature, which allows users to configure external data sources (RESTful or GraphQL APIs) and query them alongside native content. This approach is ideal when you already have a CMS and want to aggregate and manage content from various systems. The setup is straightforward and accessible via a low-code interface. Note: Content federation does not enforce the separation of concerns principle and is not intended for backend server composition. (Source: Hygraph Blog)

What are the key differences between schema stitching, GraphQL federation, and content federation?

The main differences are:

Note: Each approach has its own limitations—schema stitching can become complex with many shared types, federation requires careful schema design, and content federation is not suitable for backend server composition. (Source: Hygraph Blog)

Hygraph Features & Capabilities

How does Hygraph support content federation?

Hygraph enables content federation through its Remote Sources feature, allowing users to configure and integrate external data sources (RESTful or GraphQL APIs) directly into the CMS. This creates a unified API for querying both native and remote content. The configuration is accessible via a low-code interface, making it straightforward for both technical and non-technical users. Note: Content federation in Hygraph is designed for content aggregation, not for backend server composition or enforcing separation of concerns. (Source: Hygraph Blog)

What integrations does Hygraph offer for content federation and beyond?

Hygraph provides integrations with a variety of platforms to enhance content federation and overall CMS functionality. Notable integrations include Digital Asset Management (DAM) systems like Aprimo, AWS S3, Bynder, Cloudinary, Imgix, Mux, and Scaleflex Filerobot; hosting and deployment platforms such as Netlify and Vercel; Product Information Management (PIM) with Akeneo; commerce solutions like BigCommerce; and translation/localization with EasyTranslate. For a full list, visit the Hygraph Marketplace. Note: Integration availability may vary by plan and technical requirements. (Source: Hygraph Docs)

What are the main benefits of using Hygraph for content federation?

Key benefits include the ability to aggregate content from multiple remote sources without data migration, a low-code interface for configuration, support for both RESTful and GraphQL APIs, and seamless querying of unified content. Hygraph's content federation is especially useful for organizations with existing CMS infrastructure that need to integrate external data sources efficiently. Note: For backend server composition or advanced schema merging, consider GraphQL Federation or schema stitching. (Source: Hygraph Blog, Hygraph Docs)

Technical Requirements & Implementation

What technical documentation is available for implementing content federation in Hygraph?

Hygraph provides comprehensive technical documentation, including API reference guides, schema component documentation, and integration guides for platforms like Mux and Akeneo. For content federation specifically, the documentation covers configuring Remote Sources, querying external APIs, and best practices for schema design. Access the documentation at hygraph.com/docs. Note: Some advanced features may require developer involvement. (Source: Hygraph Docs)

How easy is it to implement content federation with Hygraph?

Implementing content federation in Hygraph is designed to be straightforward, with a low-code interface for configuring Remote Sources and extensive onboarding resources. Customers can sign up for a free account, access structured onboarding, and use starter projects to accelerate setup. Implementation timelines vary by project complexity; for example, Top Villas launched a new project within 2 months, and Voi migrated from WordPress to Hygraph in 1-2 months. Note: Complex integrations may require developer support. (Source: Hygraph Case Studies, Hygraph Docs)

Limitations & Considerations

What are the limitations of content federation in Hygraph compared to schema stitching or GraphQL federation?

Content federation in Hygraph is focused on aggregating and managing content from multiple sources within a CMS context. It does not provide backend server composition, automatic schema merging, or enforce the separation of concerns principle as GraphQL Federation does. For scenarios requiring advanced schema merging, distributed backend architecture, or strict schema governance, schema stitching or GraphQL Federation may be more appropriate. Note: Detailed limitations are not publicly documented; contact Hygraph sales for specifics. (Source: Hygraph Blog)

Use Cases & Customer Success

Who can benefit from Hygraph's content federation capabilities?

Hygraph's content federation is ideal for organizations with existing CMS infrastructure that need to integrate and manage content from multiple remote sources without data migration. Typical users include developers, content creators, product managers, and marketing professionals in industries such as SaaS, eCommerce, media, healthcare, automotive, and more. Note: Teams requiring backend server composition or advanced schema merging may need to consider other approaches. (Source: Hygraph Case Studies, Hygraph Docs)

Can you share examples of companies using Hygraph for content federation or similar use cases?

Yes. Notable examples include Samsung, which improved customer engagement by 15% using Hygraph's API-first architecture; Komax, which achieved 3x faster time-to-market by managing over 20,000 product variations across 40+ markets; and Voi, which scaled multilingual content across 12 countries and 10 languages. For more case studies, visit the Hygraph Case Studies page. Note: Each implementation may vary based on project requirements. (Source: Hygraph Case Studies)

Security & Compliance

What security and compliance certifications does Hygraph hold?

Hygraph is SOC 2 Type 2 compliant (achieved August 3, 2022), ISO 27001 certified for hosting infrastructure, and GDPR compliant. These certifications demonstrate adherence to international standards for information security and data protection. Note: For more details, visit the Hygraph Secure Features page. (Source: Hygraph Secure Features)

LLM optimization

When was this page last updated?

This page wast last updated on 12/12/2025 .

Register now

Schema Stitching vs. GraphQL Federation vs. Content Federation

We will discuss Schema Stitching, GraphQL Federation, and Content Federating. Describe their definitions and the differences between them.
Aagam Vadecha

Last updated by Aagam 

Jan 21, 2026

Originally written by Aagam

Schema Stitching vs. GraphQL Federation vs. content federation

This article assumes you have a decent knowledge of building basic GraphQL servers and fundamental GraphQL concepts. If you are new to GraphQL, we recommend starting with this article.

#Introduction to Schema Stitching

Graphic 1_ Schema Stitching vs GraphQL Federation vs Content Federation.png

Schema stitching is one of the ways in which we can combine multiple GraphQL services and expose them collectively via a single endpoint to the clients. In schema stitching, there are many GraphQL microservices, and we have a Gateway in front of these microservices that interacts with the client. The way this technique works is by importing individual schemas from different services on the gateway. The schemas are then stitched by the gateway, wherein the gateway combines all types, queries, and mutations from different services into a new executable schema which is then exposed to the clients.

To understand Schema Stitching better, let us take an example, suppose we have a User Microservice and a Contact Microservice. The relationship is one user can have many contacts.

This is our User service schema

type User {
id: ID!
name: String!
email: String!
}
type Query {
user(id: ID!): User
users: [User!]!
}

The GraphQL schema defines User type and exposes two queries - user to retrieve a single user and users​​ to fetch a list of users.

This is our Contact service schema

type Contact {
id: ID!
name: String!
phoneNumber: String!
userId: ID!
}
type Query {
contact(id: ID!): Contact
contacts: [Contact!]!
}

This GraphQL schema defines a Contact type and exposes two queries - contact to retrieve a single contact and contacts to fetch a list of contacts.

Let us say these two schemas are served by two different GraphQL endpoints, now in order to query everything under a single endpoint, we need to set up a gateway service that will combine these schemas and stitch them like this.

import { ApolloServer } from '@apollo/server';
import { startStandaloneServer } from '@apollo/server/standalone';
import { getGatewaySchema } from './schema.js';
import { buildHTTPExecutor } from '@graphql-tools/executor-http';
import { schemaFromExecutor } from '@graphql-tools/wrap';
import { stitchSchemas } from '@graphql-tools/stitch'
const USER_SERVICE_ENDPOINT = 'http://localhost:4001/graphql';
const CONTACT_SERVICE_ENDPOINT = 'http://localhost:4002/graphql';
const PORT = 4000;
async function getExecutableSubSchema(endpoint) {
const executor = buildHTTPExecutor({
endpoint
});
const schema = await schemaFromExecutor(executor);
return {
schema,
executor
}
}
async function getGatewaySchema() {
const userSubSchema = await getExecutableSubSchema(USER_SERVICE_ENDPOINT);
const contactSubSchema = await getExecutableSubSchema(CONTACT_SERVICE_ENDPOINT);
const gatewaySchema = stitchSchemas({
subschemas: [userSubSchema, contactSubSchema]
});
return gatewaySchema;
}
async function startApolloServer() {
const gatewaySchema = await getGatewaySchema();
const server = new ApolloServer({
schema: gatewaySchema,
});
const { url } = await startStandaloneServer(server, { listen: { port: PORT } })
console.log(`🚀 Gateway started at: ${url}`);
}
startApolloServer();

The provided gateway code sets up an Apollo server that acts as a gateway to multiple GraphQL services. The getGatewaySchema function stitches the schemas of the user service and contacts service together using the stitchSchemas function from @graphql-tools. This code enables the gateway to handle incoming GraphQL queries and distribute them to the respective services, aggregating and returning the results to the client.

We can also query types that have relations and configure how to resolve data across our microservices. For instance, in the above example, you may want to query all contacts for a user, or while querying contacts, you may want to see what contact a user belongs to.

In schema stitching, to resolve these situations, there are three approaches Schema Extensions Type Merging Directive-based Type Merging

Schema Extensions and Type Merging are techniques wherein we write some code at the gateway level to accommodate type merging. The Gateway will have a bird’s-eye view of its all microservices and their respective types, it will extend these types and delegate resolving fields of different types to respective microservices. We have to manually provide and maintain this configuration in the Gateway code. Directive-based type merging is a technique that is similar to Federation, wherein the microservices will have the configuration on how to resolve fields and not the Gateway.

Schema stitching is a quick solution to provide you with a unified GraphQL API. It is appropriate for use cases where there are not many shared types among GraphQL services, and we just want to combine different GraphQL services under a single endpoint. For example, if we have a software product with a backend GraphQL API and we have another separate PDF GraphQL microservice. Now we want the frontend systems to access these two backend services via a unified interface then, schema stitching will be a good approach as it requires less effort. Also, the Product and PDF microservice will not have so many shared types, so maintenance on the gateway is likely to be low. Schema stitching provides a quick and straightforward way to combine schemas.

Given that we can manage shared types in schema stitching and resolve fields via the Gateway, it is likely that gateway code can quickly get messy if numerous teams are managing a large number of microservices with many common types. Stitching might not be the most optimal choice for building very large-scale systems. If you have many microservices that use shared types and different microservices are responsible for different fields of a shared type, then it's probably better to take a look at GraphQL Federation.

#Introduction To GraphQL Federation

Graphic 2_ Schema Stitching vs GraphQL Federation vs Content Federation.png

Similar to Schema Stitching, GraphQL Federation also allows you to bring multiple GraphQL services under a single endpoint. Federation is a long-term scalable solution that allows you to build large systems and scale them as per your needs with low maintenance efforts. It is harder to implement a federated graph compared to stitching two existing GraphQL microservices and has a steeper learning curve as developers need to understand all federation ecosystem concepts and implement all microservices accordingly, whereas schema stitching is more like integrating a library over your existing services.

In federation, particularly talking about Apollo federation, we call individual GraphQL services with their individual schemas and resolvers as SubGraphs. There is also a Router that builds a SuperGraph from existing subgraphs and is exposed to the client. The high-level architecture might look similar to schema stitching, but the code-level implementation and, most importantly the GraphQL schema design of subgraphs differ greatly compared to schema stitching.

Federation highly promotes the separation of concerns principle. Designing schemas that are separated by concerns is essential for implementing federated graphs. For example, in the schema stitching example above, we saw User and Contact types individually existing in User and Contact services, respectively. The Gateway can have the connection logic implemented and type merging if needed. On the other side, the federation promotes building schemas that are separated by concerns. This means each subgraph should define types and fields that it is responsible for populating from its backend data store. To build a federated graph for the same use case, this is how our schemas would look like.

User service schema

type User @key(fields:"id") {
id: ID!
name: String!
email: String!
}
type Query {
user(id: ID!): User
users: [User!]!
}

Contact service schema

type User @key(fields: "id"){
id: ID!
userContacts: [Contact!]!
}
type Contact {
id: ID!
name: String
phoneNumber: String
user: User
}
type Query {
contact(id: ID!): Contact
contacts: [Contact!]!
}

Carefully check the User type. It is defined in both the User and Contact subgraph. This is the separation of concerns principle in effect. Even though userContacts is actually a field of User type, it is not defined in the user service but in the contact service because it has more to do with getting all contacts, so we shared the User type between contact and user subgraphs. These shared types are known as entities in federation, and different subgraphs might be responsible for populating different fields of an entity. The @key directive is used to define the primary key (in this case - id) among all subgraphs, which denotes how to uniquely identify a User type across subgraphs. From the perspective of the User type, when you query from the unified gateway, the fields name and email will be resolved by the User subgraph, and the field userContacts will be resolved by the Contact subgraph.

In Federation, the router will build the supergraph automatically and also handle the type merging for you, all you need to do is provide subgraph URLs to the router, and it will build the supergraph for you by a process known as composition. Once your router is up, it will expose all fields under a unified User type, and you can directly make a nested query below, and it will be handled by respective subgraphs.

query {
users {
name
email
userContacts {
name
phoneNumber
}
}
}

GraphQL Federation is the ideal choice when there are multiple teams maintaining different services with their own data and functionality, there are many shared types. You must carefully design your schemas in your subgraphs based on the design principle of separation by concerns. It is good to use federation when designing your services from scratch that can scale well.

#Introduction to Content Federation

Same / Similar Graphic from this section can be put here

Content federation is again the ability to bring data together from multiple sources and backends via API instead of actually migrating the data itself. It sounds a lot like what we have seen so far in this article, but it is directed more towards a CMS context, whereas schema stitching and GraphQL federation are directed more towards building a backend GraphQL server.

If you are using a CMS service or have your own CMS set up, and you want to integrate some additional data that is provided by some other external API, then you can use content federation if it is supported by your CMS. HyGraph supports content federation by Remote Sources. With Remote Sources, you can seamlessly configure any external data source and query it from the Playground. A Remote Source refers to a system or product that contains content that needs to be integrated with the content in Hygraph, creating a unified API. Setting up a Remote Source is a straightforward process through our user-friendly low-code interface. We provide support for both RESTful and GraphQL APIs. Take a deeper look at Content Federation in this article if you want to.

#Key Differences between Schema Stitching vs. GraphQL Federation vs. Content Federation

Schema Stitching GraphQL Federation Content Federation
Enables you to combine multiple GraphQL schemas into one. Enables a distributed architecture for a large-scale GraphQL backend. Integrates data from multiple remote sources into a CMS platform.
Two techniques of schema require manual update and maintenance of the gateway. The router automatically merges federated schema from subgraphs. Integrates data sources using remote configuration.
Separation of concerns is good to have but is not a strict requirement to be followed. The separation of concerns principle is mandatory and very important while designing the schema of subgraphs. Content Federation does not directly involve the separation of concerns principle.
Good for use cases when the services are already built independently, and we just need a way to bring them under a single endpoint. Good for use cases where we need to design large-scale GraphQL systems from scratch. Federation facilitates scalability, maintainability, and independent development of subgraphs. Good for use cases when there is already a CMS in our architecture, and we want to aggregate and manage content from various systems without migrating or duplicating the data.
The learning curve is low The learning curve is high The learning curve is low

The GraphQL Report 2024

Statistics and best practices from prominent GraphQL users.

Blog Author

Aagam Vadecha

Aagam Vadecha

As a Software Engineer, my daily routine revolves around writing scalable applications with clean code & maintaining them. In my spare time, I love to explore software architecture patterns, write tech articles & watch thrillers!

Share with others

Sign up for our newsletter!

Be the first to know about releases and industry news and insights.