Apollo-tooling: Error message of schema loading unclear when from server without introspection

Created on 26 Aug 2018  ยท  2Comments  ยท  Source: apollographql/apollo-tooling

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.

has-reproduction

Most helpful comment

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.

All 2 comments

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.

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..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gordanhappy picture gordanhappy  ยท  3Comments

lirbank picture lirbank  ยท  3Comments

fenech picture fenech  ยท  3Comments

lirbank picture lirbank  ยท  4Comments

arthens picture arthens  ยท  3Comments