Registry / devops / gql-sdl

gql-sdl

JSON →
library1.1.0jsnpmunverified

CLI tool for downloading GraphQL schemas (SDL or JSON) from remote endpoints via introspection. Version 1.1.0 is the current stable release; the tool is simple, single-purpose, and actively maintained. Unlike alternatives (e.g., graphql-cli, get-graphql-schema), gql-sdl does not require a full workflow setup and works out of the box with `npx`. It supports custom headers, output to file, and introspection options from GraphQL.js. Written in TypeScript and ships type definitions.

npm install gql-sdl
INSTALL
IMPORT
SIG · GQL-SDL
G
gql-sdl
devopsjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gql-sdl
npx gql-sdl https://example.com/graphql
The package is primarily used as a CLI tool. It can be run with npx or installed globally.

Downloads the GraphQL schema in SDL format from the Star Wars API and saves to schema.graphql.

npx gql-sdl https://swapi-graphql.netlify.app/.netlify/functions/index -o schema.graphql
Debug
Known issues
gotchaThe introspection options (--specified-by-url, --input-value-deprecation, etc.) may not be supported by all GraphQL servers and can cause the query to fail.
fix
Omit unsupported flags or check server compatibility.
affects: >=1.0.0
gotchaBoth --sdl and --json flags can be used together; output file base name is required in that case.
fix
Use -o FILE to specify a base filename when outputting both formats.
affects: >=1.0.0
gotchaRunning without -o flag prints to stdout; large schemas may clutter terminal.
fix
Redirect output to file using -o or shell redirection.
affects: >=1.0.0
Errors
Common errors & fixes
Error response from server: [401] Unauthorized
The GraphQL endpoint requires authentication (e.g., GitHub API) but no Authorization header was provided.
fix
Add a header with authentication: -H 'Authorization: Bearer YOUR_TOKEN'
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
gql-sdl — npm install gql-sdl · libregistry