graphql-kit / graphql-voyager

🛰️ Represent any GraphQL API as an interactive graph

Home Page:https://graphql-kit.com/graphql-voyager/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: Federation and/or multiple graphs/subgraphs

hinogi opened this issue · comments

Are there any plans to add support for working with multiple graphs in the sense of Graphql Federation with distributed graphs where you can see where the dependencies jump to a different graph?
It might be over complicated but usually there is some kind of SDL hint on what graph to jump to.

That's an interesting point, but not sure how it could be done.

From the top of my mind, if you query the gateway, it won't let you know about subgraph and this is intended.
You could potentially query all subgraphs and put together information, but won't be effective I suspect. I feel the only way would be to manually put together all the schema files and follow where the schema is extended, evaluating apollo specific directives. It feels hard.

From a consumer perspective, I am not sure about the value provided, as the consumer actually should be aware of the backend (federated or not, and how it's being federated). From a tooling perspective, it could help but not sure to which extent 🤔

It is actually more difficult, you have an SDL and an API. You can see that concept in the seldom known apollo workbench. It holds also information about the name of the subgraphs. In the example the LOCATIONS subgraph is shown. So there is a graph with information on what graphs are available and which field in which graph is external and in which not, it is only one hell of AST crawling away ;)

https://www.apollographql.com/docs/federation/v1/workbench/overview#view-supergraph-and-api-schemas