Skip to content
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] Apollo federation #299

Open
remorses opened this issue Sep 20, 2019 · 16 comments
Open

[feature request] Apollo federation #299

remorses opened this issue Sep 20, 2019 · 16 comments
Labels
enhancement New feature or request

Comments

@remorses
Copy link

The spec of Apollo federation allows to build graphql servers that can be composed one with another, i think it would be cool to implement the spec in tartiflette.
The implementation consist in implementing the following types, then the schema can be integrated in an apollo federation gateway

scalar _Any
scalar _FieldSet

# a union of all types that use the @key directive
union _Entity

type _Service {
  sdl: String
}

extend type Query {
  _entities(representations: [_Any!]!): [_Entity]!
  _service: _Service!
}

directive @external on FIELD_DEFINITION
directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
directive @key(fields: _FieldSet!) on OBJECT | INTERFACE

# this is an optional directive discussed below
directive @extends on OBJECT | INTERFACE

The spec is here
Here is an attempt of implementing it for graphene

@abusi
Copy link
Contributor

abusi commented Sep 20, 2019

Hi @remorses, Yep, this could be a cool feature. And it is well suited to be in a Tartiflette-plugin-apollo-federation.
I have to dive in the spec to see if we have everything ready in the engine for it to be implementable. But yes, it's a very good idea.
Do you wanna work on it ?

@abusi abusi added the enhancement New feature or request label Sep 20, 2019
@remorses
Copy link
Author

Yes i will work on it. Do you know if there is a way to access the complete sdl string from the resolver arguments? The spec requires that _Service.sdl returns the complete graphql schema. Or maybe the schema node classes can be dumped in sdl syntax?

@abusi
Copy link
Contributor

abusi commented Sep 20, 2019

Hum, that why I have to take time to read this spec, There are somethings that are not doable rightnow, I need to find what is needed in the Engine itself so you could implemented the Plugin and we can implement the Engine/Schema interface for you to use.

@remorses
Copy link
Author

I made a basic implementation at https://github.com/remorses/tartiflette-plugin-apollo-federation
Still it needs an implementation of the @key directive and surrounding pieces.
For that to work i need on_bake method in the directives class.

@abusi
Copy link
Contributor

abusi commented Sep 21, 2019

Yeah we'are working on this rigth now at the office. As it is a requirement for a lot of coool features, we wanna do it right, that's why we're taking some time to do it.

I'll ping you on the PR when it will be ready to show and comment. It's coming soon.

@dkbarn
Copy link
Contributor

dkbarn commented Aug 10, 2020

I'm interested in this feature too. Are there any updates?

Thanks

@abusi
Copy link
Contributor

abusi commented Aug 11, 2020

@jugdizh the plan is to have this possible in v2. RN @Maximilien-R is working on a refactoring of the validation side of the schema and query which will be the starting point of the v2 branch in which we will completly rework the schema side of tartiflette to enable these kind of feature. I think, we'll be there for 2021.

@ca-simone-chiorazzo
Copy link

@abusi Do you have an ETA for the V2 version containing this feature? We are evaluating it and we would use something of maintained because used in production. Unfortunately, graphene seems dead.

@abusi
Copy link
Contributor

abusi commented Jan 15, 2021

@ca-simone-chiorazzo Sadly, V2 will only contains tools that would help us make this, V2 should happen in 2021, but I can't get you an ETA as I'm not focused on it RN.
Tartiflette is used in production by at least 2 web companies that I know of (Dailymotion being one) without any issues for more than 2 years now, but they do not need federation.

If you really need it, and are interested in tartiflette, feel free to submit any PR, i'll gladly review it.
In the end, only some directive will need to be implemented in order to support it.

@ca-simone-chiorazzo
Copy link

@abusi Thank you for the clarification!

@gc-ss
Copy link

gc-ss commented Nov 11, 2021

V2 should happen in 2021

Excited to have federation support!

@abusi
Copy link
Contributor

abusi commented Nov 15, 2021

@gc-ss Sadly, the development speed of tartiflette is not moving fast. Appolo federation work hasn't started :D, sorry to disapoint, I don't really know if we're gonna do it :/

@gc-ss
Copy link

gc-ss commented Nov 15, 2021

I really appreciate providing this feedback!

@abusi
Copy link
Contributor

abusi commented Nov 15, 2021

@gc-ss I'm a little bit disconnected from the GQL world, I know we want to implem GQL-2021 (since we already have some of the feature, we don't miss a lot), but is appolo still a big thing in the GQL community or does the hype has gone down ?

@gc-ss
Copy link

gc-ss commented Nov 15, 2021

I won't say I am by any means connected to the GQL world either but I am looking for a framework that lets me stitch together various independent services (subgraphs) while exposing them through one API Gateway (supergraph)

Whether this is done using apollo's federation solution or something else, is secondary to having any support for it at all.

For example, taking a stab at https://github.com/movio/bramble or https://github.com/gmac/schema-stitching-handbook is a welcome pursuit 👍

@abusi
Copy link
Contributor

abusi commented Nov 15, 2021

Hum, tartiflette doesn't support schema stitching, in the sense that tartfilette does need the complete schema to work. But on a complete schema, a resolver can query a remote service without any problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants