MichaelJCompton commented :
Hi @mac2000 and @StevenACoffman,
Thanks for the interest in Dgraph GraphQL and for the ideas around Apollo Federation. This is a bit of an intricate one, so sorry for the long reply.
A few technical points first. We don’t take a dependency on graphql-go. Nor do we really take a dependency on gqlgen - I think we use one bit to help respond to GraphQL introspection. So supporting Apollo Federation would mean us implementing it. It’s not as simple as flicking it on.
That said, we did cut a branch at one stage to test building it out, which worked fine, but we weren’t convinced it should be built directly into Dgraph for these reasons:
- It’s not part of the GraphQL spec, it’s a cool feature built by Apollo. Which is nice, but meant it wasn’t on our core roadmap for our spec compliant GraphQL support. It’s also not the only suggestion around for federation: for example, at GraphQL java, they are building a federation engine nadel that works the other way around by the federation saying what parts of the services it is federating, rather than the services telling the federation how to federate them. Which is a cool idea because it makes the federated services independent of the federation.
- Because it’s part of another product, rather than the GraphQL spec, it’s likely to make it more of a moving target for us to support.
- It’s able to be done already by putting an Apollo server as a proxy in front of your Dgraph instance. That’ll take a small amount of boilerplate, but I currently feel that if you are building an Apollo federation, it’s likely that you have the capability for that, and it’s a more Apollo native solution than us baking it in. (we have a blog coming soon around this)
- There are other things arriving around federating GraphQL that I expect are likely to be more flexible than us building in one solution for Apollo federation. I’ve mentioned Nadel, but also I think (but haven’t yet tried a working example) that GraphQL Mesh (https://graphql-mesh.com/) could be a really cool way to get federations (including Apollo Federation) without it having to be hard coded into our service.
So … yes it’s a cool idea; no it’s not on the roadmap for the next quarter; yes please put up a feature request if you really want it built in (that’ll help us gauge interest).
We are also watching this space with interest and will build out some examples around the products mentioned above over the next few months so we can give some guidance on how to use what’s already available, and work out if we need to take something on, say Q4 2020 or beyond.