-
Notifications
You must be signed in to change notification settings - Fork 85
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
fetching a remote schema throws 400 errors #573
Comments
Hi @opsinghis - thanks for the report. The command you're looking for here is |
Hence in this case - i would need to download the schema using rover graph introspect, and manually convert them to a specification of sub graphs and then imprort them back as subgraphs. I would assume most third party remote graphs are unlikely to adhere to federation specification - hence the only option left for us is to manually convert them. Om |
Yup! That's exactly right. There are docs here that might be able to help with this conversion process. |
This should be fixed with a better error message in v0.1.5! Please feel free to reopen this issue, or create a new issue if you are still having issues. |
Hi I know this issue is closed but I'm encountering a similar issue that returns the same 400 error. Now, I would like to fetch the GraphQL server's schema via introspection and write it to a
but it returns the following:
I tested the command against a locally running apollo server (w/out the API key) and it works. I also made sure the env variables are populated with the correct values via Any idea what the cause of this is? |
That's strange @gevuong - what version of Rover? Also, maybe you could get some more information here if you run the command with |
I ran with According to logs, it looks like a connection was made to the server, headers were parsed, and the body of the request was received. But afterward, it throws a 400 😕 . And yes, the expected API key name is
|
That's so strange! OK I'm going to recommend that you try running the query that Rover is running here as a curl -X POST https://my-api.com/graphql -H apikey:myapikey -H content-type:application/json -H user-agent: rover/0.6.0 -d '{"variables":null,"query":"query GraphIntrospectQuery {\n __schema {\n queryType {\n name\n }\n mutationType {\n name\n }\n subscriptionType {\n name\n }\n types {\n ...FullType\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n }\n }\n }\n}\n\nfragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type {\n ...TypeRef\n }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}","operationName":"GraphIntrospectQuery"}' |
Alrighty, so with the help of your curl command, the returned error stated introspection needed to be set to true. With that being said, based on Apollo Server docs, under the introspection schema option, It is important to note, however, that I am using Anyway, thanks for all your help, @EverlastingBugstopper! |
Description
I am trying to get a remote schema using command below. This schema is from commercetools.
rover subgraph introspect https://api.europe-west1.gcp.commercetools.com/XXXXXX/graphql --header "Authorization:Bearer XXXXXXXXXXXXXXXXXX"
I am getting the following response
error[E004]: HTTP status client error (400 Bad Request) for url (https://api.europe.west1.gcp.commercetools.com/XXXXXXXX/graphql)
This error was unexpected! Please submit an issue with any relevant details about what you were trying to do: https://github.com/apollographql/rover/issues/new/choose
I use another cli utility from “get-graphql-schema” and this works perfectly fine
Steps to reproduce
Commercetools is a headless commerce platform. I am trying to configure federation across commercetools and contentful both of them support graphql.
In order to setup subgraphs as described in the documentation
https://www.apollographql.com/docs/federation/quickstart/
I am configuring the application to get the commercetools schema, by replicating the advised command
rover subgraph introspect https://rover.apollo.dev/quickstart/products/graphql
Expected result
I should get access to graphql schema.
Actual result
error[E004]: HTTP status client error (400 Bad Request) for url (https://api.europe.west1.gcp.commercetools.com/XXXXXXXX/graphql)
This error was unexpected! Please submit an issue with any relevant details about what you were trying to do: https://github.com/apollographql/rover/issues/new/choose
Environment
Run
rover info
and paste the results hereIf you can't run
rover info
for some reason, please provide as much of the following info as possible:rover --help
):The text was updated successfully, but these errors were encountered: