Common issues with schema stitching
April 17, 2019 at 12:38pmCommon issues with schema stitching
April 17, 2019 at 12:38pm (Edited 3 years ago)Schema stitching is an interesting concept but requires a lot of discipline from a team to implement it correctly and keeps room for shooting yourself in the foot. This post already does a great job of explaining the key shortcomings of a schema first approach. I just wanted to have a common place to list out most of the practical issues from the schema stitching ecosystem just to have a reference for evaluating schema stitching as a tool.
Stitching essentially adds more layers to your architecture and makes it difficult to pin point where something (error or some data transformation) happened in a layer unless you are very disciplined into tagging each layers response with some metadata. These layers and general architecture of schema stitching makes the following issues more pervasive:
Keeping schemas in sync across layers:
- https://github.com/apollographql/graphql-tools/issues/791
- https://spectrum.chat/apollo/general/best-practices-for-type-conflicts-after-schema-stitching~ba2fe474-e432-4cb2-9c6c-bf00161d2118
Alias furling/unfurling across layers
- https://github.com/prisma/graphql-yoga/issues/340
- https://github.com/apollographql/graphql-tools/issues/519
- https://github.com/apollographql/graphql-tools/issues/415
- https://github.com/graphql-binding/graphql-binding/issues/169
- https://github.com/prisma/prisma-binding/issues/176
Error propagation:
- https://github.com/apollographql/graphql-tools/issues/743
- https://github.com/prisma/prisma/issues/2199
General observations:
- https://github.com/graphql-binding/graphql-binding/issues/80
- https://medium.com/@xuorig/on-graphql-schema-stitching-api-gateways-5dcb579fa90f
Note that some of the above issues are closed but not gracefully. Schema stitching still can be a good alternative to make a common layer of business splitting other GraphQL services like micro service but would require discipline like adding metadata for error propagation, avoiding name collisions by some sort of name spacing or conventions etc which makes it difficult to use that at scale.