SuperGraph and SubGraphs in Different Languages

Few Questions for this great community -

  1. Do we think there will be an issue if the SuperGraph/Federation/Router is implemented NodeJS where the contributing Subgraphs are implemented using say Java-SpringBoot. I understand the every language has its own/different support for certain constructs that Apollo Provides at the Router/Schema/Type/Directives level, but overall is there a problem with this mixed approach.
  2. Can a Federation/Gateway layer - in The Service List include an endpoint that is another Federation/gateway. In an enterprise if there are two Federation/Apollo Gateways , do we create another gateway that includes these two as Service List (if possible) or its better to have consumer use them separately whereever they need.
    Thanks much in advance …

re: 1 - There is no problem with this approach and it is pretty common pattern - you can use any Federation compatible subgraph behind gateway/router. Check out Federation-compatible subgraph implementations - Apollo GraphQL Docs for info about currently supported subgraph libraries and GitHub - apollographql/apollo-federation-subgraph-compatibility: A repo to test subgraph libraries compatibility with the Apollo Federation Specification for their example integrations.

If you want to use Java (using SDL first approach) check out Netflix DGS framework and Spring GraphQL (used by our federation-jvm example). If you prefer code first approach (and are open to Kotlin) take a look ExpediaGroup graphql-kotlin as well.

1 Like

Thank you and good to know. So router/gateway and contributing subgraphs as co-live and work together implemented in different but supporting languages.

Any viewpoints on my second question and if its not clear , please let me know , I can frame the question in a different way.