A CLI tool and library (v1.1.0) for fetching a GraphQL schema from a remote endpoint and writing it to a local file. Lightweight wrapper around introspection queries, supports JSON and SDL output formats, cookie-based auth, and custom headers. Stable but low-maintenance; no recent releases. Simpler than graphql-cli's schema download — no dependencies beyond Node.js built-ins.
npm install graphql-fetch-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to fetch and save a GraphQL schema using the library API with auth header.
Verify the endpoint returns a valid GraphQL schema before calling fetchSchema.
Use ESM imports or dynamic import().
Combine cookies into one string (e.g., 'a=1; b=2').
Change to import fetchSchema from 'graphql-fetch-schema' (no curly braces).
Use the CLI: npx graphql-fetch-schema <url>.
Ensure the output directory exists before calling fetchSchema.
No dependency data recorded yet.