CLI tool to fetch and print the GraphQL schema from a GraphQL HTTP endpoint. Current stable version is 2.1.2, released in 2018, with low release cadence (no updates since 2019). It outputs schema in IDL syntax by default, with optional JSON output. Alternatives like graphql-cli offer richer workflows. Supports custom headers via --header flag. Suitable for quick schema retrieval, especially for Relay Modern projects.
npm install get-graphql-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Fetch and print the GraphQL schema from a public endpoint using custom headers, output SDL.
Use graphql-cli or graphql-request with introspection query.
Use dynamic import() or switch to CommonJS-compatible library.
Wrap calls in try-catch and validate URL before passing.
Use import statement or dynamic import: const { getGraphQLSchema } = await import('get-graphql-schema');Use named import: import { getGraphQLSchema } from 'get-graphql-schema';