-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support Apollo Graphql Federation #492
Comments
this seems outside the scope of this project. |
How so? Supporting the parts of the Apollo spec to allow others to use this project to build federated graphql microservices seems pretty in scope. |
Federation is an Apollo spec not a graphql spec. This library implements the graphql spec https://graphql.github.io/graphql-spec/June2018/ which has no mention of federation. |
Actually I apologize. I realize you are just asking this library to support the additions not federation itself. I believe the additions should be in scope |
No worries, I clarified my request. Sorry for not being more clear from the beginning. |
You could implement federation in a separate library. See for example: https://github.com/0xR/graphql-transform-federation. It takes an existing schema and with some configuration it can add federation support. Note that that is a NodeJS implementation, but I'm sure it could be implemented in Go as well. If you're ok with running NodeJS you can add federation support to your Go service by using graphql-transform-federation as a middleware service. It can take a remote schema as input as well. |
Is there interest in this library supporting this? I've read the federation spec a couple of times now and it seems at a high level this library would need to support:
It seems that this spec could be entirely implemented in another package as long as this package is able to expose its AST. If anyone has any thoughts or feedback I'm interested in hearing them. Also if @chris-cp is interested in supporting this but maybe does not have the time, then I would happy to take a shot and open a PR. |
Anyone knows about any library to handle this? |
gqlgen has supported it for some time. |
Federation is not exclusive to Apollo https://movio.co/blog/building-a-new-api-platform-for-movio/ |
If someone es is looking for this, you can build your own with: https://github.com/jensneuse/graphql-go-tools |
Any plan to support this feature in the future? |
Huge +1! The team at MongoDB also uses this package for our hosted GraphQL API endpoint. It would be a great add-on feature on top of our generated GraphQL Schema and would be valuable to get customers on-board with adopting GraphQL more widely in their organizations in a scalable manner. |
I took a stab at implementing federation with this library and it seems like the primary blocker here is that we can't specify directives for types (ie, ObjectConfig doesn't support setting directives). It is also non-obvious if it is possible to render an SDL from a Schema object. |
Update type definitions to expose `AppliedDirective`s. **This initial implementation only exposes applied directive as metadata and does not modify runtime wiring to process them**. Exposing directives is a pre-req to enable support for [Apollo Federation](https://www.apollographql.com/docs/federation/) (related: graphql-go#492). Following the pattern from [`graphql-java`](https://github.com/graphql-java/graphql-java) and [`HotChocolate`](https://github.com/ChilliCream/hotchocolate) where they make distinction between directive type definition (i.e. `directive @foo on FIELD_DEFINITION`, maps to existing `Directive struct` for backwards compatibility) and where directives are actually applied within the schema (i.e. `type Foo @bar { baz @Qux }`, maps to new `AppliedDirective` struct`).
Hello 👋 I forked I've also created a tag for easier integration -> https://github.com/dariuszkuc/graphql/releases/tag/v0.9.0-federation Would love to get some feedback! |
Feature Request:
Please consider supporting Graphql Federation. This does not necessarily mean implementing all of the Apollo Federation Spec in this library, but just what would be necessary for someone implementing Apollo Federation to use this library for that purpose.
https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
Background:
We use hundreds of microservices, and a monolithic GraphQL server becomes an unacceptable development bottleneck and single point of failure, so it becomes necessary to divide the graph's implemention into separate parts. We tried schema stitching, but would prefer federation for three reasons:
The text was updated successfully, but these errors were encountered: