What's the difference between GraphQL federation and schema stitching?

Asked 3 years ago

I'm a little confused when it comes to GraphQL federation vs. schema stitching. What's the difference between the two? When is one better to use than the other? Thanks in advance!

Kaiden Sparks

Sunday, April 24, 2022

The main difference between GraphQL federation and schema stitching is the first one's gateway is the usual agent that merges them and is well aware of the data of each other. On the other hand, schema stitching services are not aware of each other's data.

Lanny Sutton

Thursday, July 21, 2022

GraphQL federation allows you to break up your schema into smaller pieces that can be composed. It gives you more flexibility in structuring your data and makes it easier to scale your schema as your application grows.

Schema stitching, on the other hand, stitches together existing schemas. It can be easier to set up in the short term but can create long-term problems. So, in GraphQL federation vs. stitching, my vote goes for GraphQL federation as it is a sustainable and long-term solution for most applications.

1

Abeeha Qasmi

Friday, October 21, 2022

Schema stitching allows you to build a single GraphQL endpoint called "Gateway." It can query data from multiple sources while keeping your data organized. Whereas federation exposes multiple APIs, each having its own implementation of GraphQL. The above facts make it clear that if you want a distributed API responsibility, GraphQL federation would be a good fit for you. On the contrary, schema stitching is the way to go if you want a centralized API responsibility.





Write an answer...

Cancel

Please follow our  Community Guidelines

Can't find what you're looking for?