Providing Schema
GraphQL Inspector - There are a few options to provide your schema in GraphQL Inspector.
There are a few options to provide your schema in GraphQL Inspector.
JavaScript And TypeScript File
GraphQL Inspector accepts CommonJS and ESModules
If you need to transpile a file, use --require option of the CLI:
GraphQL File
Files with those extensions: .graphql, .graphqls or .gql are supported by GraphQL Inspector.
JSON File
A JSON file with introspection results can also be provided:
GraphQL Endpoint
GraphQL Inspector can also introspect your GraphQL server:
Git Repository
Get GraphQL Schema file from any branch or commit of your git repository:
For example, you want to get schema.graphql from origin/master:
GitHub Repository
Yes, GraphQL Inspector can also do that, here’s the pattern:
github- stays there, it tells Inspector we want to use GitHubowner- your GitHub username or organizationname- repository’s nameref- can be the name of a branch or commit shapath/to/file- where Inspector can find the GraphQL file
For example, we want to fetch a .graphql file from master branch of this sample repository:
Programmatic API
If you are using programmatic API, you might find @graphql-tools/load package useful for loading
schemas. Learn more here.