Centralise Federation stitching logic from subgraphs to Gateway/Router

Hi everyone,

I have been trying and testing about Apollo and its GraphQL services in relation with work for a few weeks now, and I have hit a wall in a couple of topics.

The main problem I have encountered is when building out a federation from subgraphs I do not own. In the documentation and in the Apollo Odyssey Tutorials, when I wanted to query data across multiple subgraphs, I had to explicitly specify in the subgraph schema, which fields I can involve from another subgraph.

In case when I don’t have the opportunity to change an API’s/subgraphs’s source code, what can I do in order to centralise the stitching logic to the Gateway/Router? Are there any other possibilities than doing it in each subgraph respectively?

Another question that came up from not owning a certain API that I want to federate is that how do I involve a not federated API in a federated graph? Do I always have to create a wrapper/proxy API, which uses the functionality of the desired API but also adds the federation requirements to the schema, or is there a more simple approach?

I hope my thoughts and concerns were comprehensive and I would really appreciate any kind of help or clarification regarding these.

Thanks a lot,
Peter