Merging schemas
Problem
I work on a huge project. To ensue project's long-term maintainability we decided to split the application into 3 standalone pieces thus we now have 3 specialized teams. Each app exposes its own GraphQL schema. At the end we plan to create the 4th app which will merge all 3 pieces together into a `gateway` application using the `express-graphql` package. What is the best way to merge schemas? What we would need is a mechanism similar to Express Router. Our current plan is to make all 3 apps available as private packages from which we can build a new schema for the main (4th) app. Well, we could make each app act as a standalone private graphql server and then the main application would just send requests to sub-apps but I believe it could potentially represent a huge overhead. Am I wrong? Are there any plans for supporting this? What do you suggest? How do you handle this at Facebook?
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Merging schemas
We maintain one schema at Facebook. Different teams are responsible for maintaining the types that are specific to their products, but there is only one final schema that combines all the types together into one GraphQL service available to our client applications.
Trust Score
6 verifications
- 1
We maintain one schema at Facebook. Different teams are responsible for maintain
We maintain one schema at Facebook. Different teams are responsible for maintaining the types that are specific to their products, but there is only one final schema that combines all the types together into one GraphQL service available to our client applications.
Validation
Resolved in graphql/graphql-js GitHub issue #223. Community reactions: 27 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep