-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cannot query field "_service" on type "Query" #3419
Comments
I have the same problem. It looks like these are added by apollo-federation and apollo-gateway assumes they are always there. If you're trying to forward to a third-party graphql, that won't work :( |
I find myself in the same situation, it would be nice if we didn't have to do this, especially since some of these 3rd party graphql services are behind walls we don't control :( |
I wound up implementing it with the "deprecated" schema stitching. It turns out that there's nothing preventing you from doing that, except that the necessary helpers now live in All you're doing is creating a Link, using that to fetch and wrape the remote schema, turning it into a local schema, and then merging it with your or other schemas. As long as you don't need the "foreign key" functionality of federation, this should always work. Therefore I think the docs should be updated to mention this. |
I had the same and it really defeats what I needed. I just want to setup a simple gateway to route requests and merge results and thought that is what gateway was for. @wmertens Do you have any examples or good places to explain how to do the stitching? |
I found an excellent article and created a proof of concept that works perfectly. So I'll stick with stitching for now until it's supported by Sangria, Graphene and all the other libraries, not just Apollo |
The downstream services in a federated architecture must implement the federation specification. Many GraphQL servers have already implemented the federated specification already, including |
@abernix why can't the federation support be optional, and if it's missing the assumption is that all federation metadata is empty, so federation falls back to simple stitching? |
@Kwadz FWIW, I abandoned using Drupal/GraphQL in favor of wrapping the Drupal RestUI module with Apollo Rest DataSource. I also wrapped another 3rd party api with the same package, works much better for our team than mucking around in PHP 🤷♂ Apollo Rest Datasources can be wrapped with the "buildFederatedSchema" function from the Apollo Federation package, automatically configuring the federation specification for you. |
Running into this issue now with faunadb downstream. Very annoying. |
For anyone still struggling with this, check out: Which makes good use of Your mileage might vary, but thanks to that project, I've been able to bring a complex remote schema on board of our federated graph. Took me just a couple of hours. |
FYI for anyone stumbling into this and trying to figure it out. That project is out of date and doesn't work with latest Apollo libraries. I'm going to try to take that and see if I can re-engineer it so that I can federate over an existing schema (which I can't change) with latest Apollo server + Gateway |
I'm using Apollo Federation to connect to a GraphQL server made with Drupal GraphQL.
So I configured the gateway:
But when I start the server I get:
The text was updated successfully, but these errors were encountered: