I’m new to both concepts so excuse me if it’s opinion-based. Currently, I’m looking at Apollo Federation and schema stitching provided by the graphql-tools package, though I guess it applies to similar packages. Could something like a table be created describing certain requirements/conditions to prefer one over the other?
1 Answer
Apollo’s GraphQL Federation and "schema stitching" both accomplish a similar goal: unify multiple GraphQL APIs under a single GraphQL API.
Based on my understanding, the main differences between them are:
Apollo’s Federation | Schema stitching |
---|---|
subgraph services own the logic for linking shared types together | the gateway owns the logic for linking shared types together |
distributes the ownership of subgraphs to the individual service teams | assumes centralized responsibility of the full schema |
tightly coupled to the Apollo ecosystem | more open source |
For more details, I’d recommend reading https://product.voxmedia.com/2020/11/2/21494865/to-federate-or-stitch-a-graphql-gateway-revisited.