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
Error 400 when working with rover graph introspect #1445
Comments
I debuged it further looks like you send request with JSON like this But apollo server v4 is not expecting to get this as a null Looks like this change was introduced 15 days ago apollographql/apollo-server@37b3b7f and this a regression between rover and server |
This PR adds the spec audit suite from `graphql-http` (designed to validate compatibility with the "GraphQL over HTTP" specification) to the integration test suite. It expects all required (MUST) audits to pass, and for all optional (MAY/SHOULD) audits to pass that we haven't explicitly excepted. All required audits already passed. Failing optional audits fell into three categories: - Ignoring `operationName`, `variables`, and `extensions` when provided with incorrect types instead of returning a 400 error. The SHOULD here seemed reasonable and so this PR changes our POST handler to return 400s if incorrect types are provided here. As described in the changeset, this is backwards incompatible but we are comfortable making this choice today. - Returning 400 errors for various error conditions like GraphQL parse errors, for the original `application/json` response type. The one aspect of the GoH spec that is prescriptive rather than descriptive is the invention of the `application/graphql-response+json` response MIME type; the theory is that you can't really "trust" that a non-2xx response with MIME type `application/json` is actually generated by the GraphQL server rather than by some other proxy, so it has you use this new type along with 4xx for these errors, and then SHOULDs that these errors come with 200 for the original MIME type. The main reason that this is a SHOULD is because many servers like Apollo Server already return 400s in this case, and we're not interested in changing that. So we ignore these particular errors. - There's a sorta buggy audit that has opinions about how bad JSON errors should look. See graphql/graphql-http#25 Note that we deliberately make a strict dependency on a single version of graphql-http, so that the tests run by a given version of `@apollo/server-integration-test-suite` are well defined. Fixes #7158. Co-authored-by: Denis Badurina <badurinadenis@gmail.com>
Hi @tsibelman - this was a regression in Apollo Server 4.2.0 and was fixed in this PR. If you update to apollo server 4.2.2 this issue should be resolved. |
Description
Created an Apollo express server, was able successfully go to http://localhost:4000 in the browser and expect the schema.
Tried to run "rover graph introspect http://localhost:4000" get back 400 error. If I run rover with debug logger, I see an error like this:
Steps to reproduce
A minimal repro app
Environment
Rover Info:
Version: 0.10.0
Install Location: /Users/michaeltsibelman/repos/docontrol/adam/node_modules/binary-install/node_modules/.bin/rover
OS: Mac OS 13.0.1 [64-bit]
Shell: /bin/zsh
The text was updated successfully, but these errors were encountered: