-
Notifications
You must be signed in to change notification settings - Fork 492
Apollo Federation Compatibility #528
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
Comments
Hello 👋 Based on my cursory glance, it appears that this library currently has very limited Federation support (i.e. just supports I recently introduced Federation support to *PRs are still open and pending |
Hello 👋 |
Hi @dariuszkuc and @maryelizbeth Thank you for the interest. PRs would be considered and accepted as long as they do not introduce backwards compatibility and do not increase significantly the complexity of the library. I'd be happy to discuss any potential changes required. I'm more interested to know which features of the GraphQL spec are missing in this library that would prevent you to consume schemas from this library from Apollo. The way I see it there are two sides to this issue:
Am I understanding this correctly? |
Hello 👋 I was hoping we could create new
IMHO without having the library support (# 2), users writing their GraphQL servers (# 1) have to keep re-implementing it (# 2) themselves. In order to create Apollo Federation compatible subgraphs we need to make few schema modifications:
Based on my brief exploration, I don't think there would be any changes to the core lib and fed support could be provided through a new package (see above). Guess if we would like to keep |
@dariuszkuc thank you for putting down your thoughts. Do you think such a package would require any additional dependencies? Ideally, I do not want to add dependencies to the library. I like the idea of making the |
Hello 👋 Apologies but I didn't get a chance yet to work on this. Creating new federation package should be simpler now as well, I just externalized our fed compatibility test suite (blog post coming soon) so library authors can run tests before adding integration to our testing repository. Integration tests can now be run using executable NPM script and Github Action. |
Is there any roadmap or plans to support a more meaningful set of features for Apollo Federation in the near term? Having just started decomposing a large graphql-go application, we were pretty gutted to find things just didn't work as we hoped. |
@steve-gray The goal of this library is to support the official GraphQL spec. Apollo Federation is not in the short-term roadmap. With that being said, PRs extending the library and covering any missing pieces from the official GraphQL spec are more than welcome. If a feature can be added in an opt-in way without changing the core of the library then it would be considered. |
Just for the sake of clarity, the problem I have with adding Apollo Federation support in this library is that it is not in the official GraphQL spec. And if it is not in the official GraphQL spec it might change in future. I'd be more than happy to consider adding missing pieces of the puzzle (from the official spec) that would allow users of this library to implement Apollo Federation themselves. There has been Apollo schema stiching, then federation v1 and now federation v2. Once federation is considered stable and accepted in the official GraphQL spec, then I'd reconsider adding it to the core of this library. I'm not afraid of joining late to the party, however, I'm definitely afraid of joining too early. In the mean time any ideas, improvements or PRs are welcome. |
The main areas would be:
That would at least in principal allow the package to be used with an external federation router that handles the supergraph and cross graph joining. |
This weekend I decided to actually learn more about Apollo Federation and try to run the full Apollo Federation Subgraph using this library. So far it is (almost) working, however, there is one small issue remaining. This library requires Go fields/methods corresponding to a GraphQL field to be exported (public fields). This means that if I have a func like: func (r *QueryResolver) _Entities(ctx context.Context, args struct{ Representations []Any }) ([]entityResolver, error) {
// ... resolver here
} it wouldn't work because the above func is private in the Go world since it doesn't start with a capital letter. Of course, I can add a schema option which adds this resolver field, however, I want to resolve this in a way that would make the library compatible with the latest GraphQL spec and allow users to define resolver fields with leading type queryResolver struct {
Entities func(ctx context.Context, args struct{ Representations []Any}) ([]entitiesResolver, error) `graphql:"_entities"`
} Note the |
While trying the above I fixed two bugs in the library to make it compatible with the latest stable spec. So thank you for raising this. |
Thanks for the update. Awesome progress! |
@dariuszkuc @steve-gray @maryelizbeth |
Hi Y’all,
Super excited to see that 1.4.0 included support for Apollo Federation.
Our team at Apollo maintains the Apollo Federation Subgraph Compatibility repo. Our goal for this project is to highlight projects that have support for Apollo Federation so that users of those libraries can see a visual representation of that support. We also include libraries in this list within our test suite to further validate their functionality.
If you’d like to have your project tested against the Apollo Federation spec and displayed within this list, you can take a look at getting started here, or open an issue on our repo.
Our team is happy to help with the process and answer any questions! Let me know what y’all think.
The text was updated successfully, but these errors were encountered: