walmartlabs / lacinia

GraphQL implementation in pure Clojure
http://lacinia.readthedocs.io/en/latest/
Other
1.82k stars 163 forks source link

Apollo's Federation Spec #289

Closed wbeard closed 4 years ago

wbeard commented 5 years ago

Hi there,

First of all, thanks to all of the maintainers and contributors for building and open sourcing lacinia. It's been a pleasure to work with so far.

We're using lacinia for a GraphQL server and are interested in composing it together with some other GraphQL servers with something like the Apollo Gateway and federated services. It appears that the Apollo team has put together a spec to make composing services into a gateway, without the need to stitch together remote schemas.

I was curious if this was on your radar and how you see lacinia providing this functionality, should a team using lacinia need to add their service to a gateway? Would this be a separate implementation/project?

hlship commented 5 years ago

I haven't looked at their spec but it sounds interesting.

emilssolmanis commented 5 years ago

Tentatively interested as well, our org has a number of places that currently use schema stitching and we found Federation, so it's plausible we'd end up looking into this, and / or contributing.

hlship commented 5 years ago

I haven't looked at the spec, but is this something that could be implemented as an add-on to Lacinia, rather than in core? Feels like Lacinia should make it easy, i.e., merging together some EDN schemas.

wbeard commented 5 years ago

but is this something that could be implemented as an add-on to Lacinia, rather than in core?

Perhaps it would just be a function you'd pass the schema to that would build the necessary extra types, directive definitions & entity union? We're using lacinia-pedestal if that changes how this would be exposed?

gklijs commented 4 years ago

Seems to me like there are three parts, which are needed to get this working:

That being said from speaking to some people at GraphQL Summit not everybody thinks Appolo federation will be the future of combining different GraphQL micro services. In line with that few will benefit from adding support for it. Testing it properly will also be a lot of work.

This is how they did it in Kotlin, https://medium.com/expedia-group-tech/apollo-federation-in-a-graphql-kotlin-server-115cea51607a

neilprosser commented 4 years ago

I've had a go at this and the code is here: https://github.com/atomisthq/lacinia-apollo-federation. You can use it with the [com.atomist/lacinia-apollo-federation "0.1.0"] coordinates. I've only used it for an example app so far but it wired up with a couple of other Apollo apps and an Apollo gateway.

Interested in hearing feedback on it and more than happy for this to be lifted into Lacinia as well.