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

Error message of schema loading unclear when from server without introspection #560

Closed
danilobuerger opened this issue Aug 26, 2018 · 2 comments
Labels
🌹 has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository

Comments

@danilobuerger
Copy link
Contributor

Regression of #533

Error message is now:

$ apollo schema:download --endpoint ... schema.json
 ✔ Loading Apollo config
 ✔ Fetching current schema
 ✖ Saving schema to schema.json
   → Expected undefined to be a GraphQL schema.
Error: Expected undefined to be a GraphQL schema.

previously it was:

$ apollo schema:download --endpoint ... schema.json
 ✔ Loading Apollo config
 ✖ Fetching current schema
   → Response not successful: Received status code 400
   Saving schema to schema.json
Error: Response not successful: Received status code 400

Is it now unclear why the command failed.

@ghost ghost added the 🌹 has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository label Aug 26, 2018
@jhalborg
Copy link

jhalborg commented Sep 10, 2018

I want to upgrade from CLI 1.6 to 1.9.1, but this error i stopping me. How do I fix it?

"codegen": "yarn introspect-engine && yarn types",
"introspect-engine": "npx apollo schema:download schema.json",
"types": "npx apollo codegen:generate --target=typescript --clientSchema=src/localState/clientSchema.graphql --queries=\"src/**/*.{ts,tsx}\" --schema=schema.json --addTypename",

Running yarn codegen gives the following output, but works fine on 1.6:

yarn run v1.9.4
$ yarn introspect-engine && yarn types
$ npx apollo schema:download schema.json
 ✔ Loading Apollo config
 ✔ Fetching current schema
 ✖ Saving schema to schema.json
   → Expected undefined to be a GraphQL schema.
Error: Expected undefined to be a GraphQL schema.

@paddotk
Copy link

paddotk commented Nov 1, 2018

The update didn't fix this for me. With Apollo 1.9.2 I get the same error. Also a pity that the error isn't more descriptive..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌹 has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository
Projects
None yet
Development

No branches or pull requests

3 participants