by avitzurel · 7y ago · 0 comments
We have multiple "gateways" for multiple backend services.
We have our main application that has one graph and we have multiple internal applications each owns its own graph.
I don't think the main application needs to know about the other internal graphs, nor should it have access to it (it should not even discover it).
* Non-GraphQL services (speaking REST, gRPC, whatever) * GraphQL gateways, owned by frontend teams/applications.
E.g. each frontend team/application owns its own schema owned by these teams. They can compose the backend services however they wish—and whatever is the most natural representation for their domain.
Yup, we see this pattern a lot. You get the benefits of fewer bytes on the wire, typed APIs, elimination of data fetching code, etc.
But it leaves a lot on the table. The bigger wins come when new features can draw from all your data (in unanticipated combinations) without new API or services development, when you can make new data available for every team's use just by plugging it into the central graph, and when you have a birds-eye view of exactly how all your data is being used so you know where to make further investments.
Am I missing something here? Has this been addressed?
Thanks.
I think 'One Graph' makes sense if that's how you model your data under the covers (e.g. Facebook's graph store)—but if you're in a service-laden world, it makes far less sense.
You can't control malicious clients so I don't think the access part holds much water.
I think they are advocating a monolith deployment to maintain contracts across ownership and client expectations as a best practice vs the version management of multiple graphs requiring different cross sections of data for each client. It helps keep it consistent.
my 2 cents
We don't use a mono-repo, we use a repo per service.
We have shared libraries like https://github.com/globality-corp/nodule-graphql that make generating gateways easy and straight forward.