menu

graphql-inspector

🕵️‍♀️ Tooling for GraphQL. Compare schemas, validate documents, find breaking changes, find similar types, schema coverage.

Channels
Team

Can't do a simple introspect

July 9, 2019 at 8:46pm

Can't do a simple introspect

July 9, 2019 at 8:46pm

I'm running the following script on this schema: https://github.com/VandyHacks/vaken/blob/dev/src/common/schema.graphql.ts

Script: graphql-inspector introspect src/common/schema.graphql.ts --write schema.graphql --require ts-node/register

This is the error I get. The file definitely isn't missing a default export. I don't really have more specific debugging information or anything so I don't feel like I have enough to create a GH issue so I was hoping this place could help out.

Invalid export from export file /Users/cooben/Documents/vaken/src/common/schema.graphql.ts: missing default export or 'schema' export!
error
Error: Unable to load schema from file "src/common/schema.graphql.ts" due to import error: Error: Exported schema must be of type GraphQLSchema, text, AST, or introspection JSON.
at /Users/cooben/Documents/vaken/node_modules/graphql-toolkit/src/loaders/schema/schema-from-export.ts:98:39
Error: Exported schema must be of type GraphQLSchema, text, AST, or introspection JSON.
at /Users/cooben/Documents/vaken/node_modules/graphql-toolkit/src/loaders/schema/schema-from-export.ts:87:25

August 12, 2019 at 11:15am

Latest version should fix it

  • reply
  • like