{"id":47983,"library":"graphqldoc","title":"Graphqldoc","description":"Static page generator for documenting GraphQL schemas, version 2.5.2. A maintained fork of the unmaintained graphdoc package. Provides CLI and plugin system to generate documentation from live endpoints, IDL files, modular schemas, or introspection JSON. Outputs static HTML pages with customizable templates and plugins. Suitable for documenting GraphQL APIs in a project.","status":"active","version":"2.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/CodeSignal/graphqldoc","tags":["javascript","graphql","graphdoc","graphqldoc","docs","documentation"],"install":[{"cmd":"npm install graphqldoc","lang":"bash","label":"npm"},{"cmd":"yarn add graphqldoc","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphqldoc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for schema parsing and introspection; required unless using only live endpoint with introspection.","package":"graphql","optional":true}],"imports":[{"note":"CLI tool; best used via npx for temporary execution or globally installed. Not a library import.","wrong":"graphqldoc (without npx if not installed globally)","symbol":"graphqldoc (CLI)","correct":"npx graphqldoc -e http://localhost:8080/graphql -o ./doc/schema"},{"note":"PluginInterface is a type exported for TypeScript; use 'import type' for type-only imports.","wrong":"import { PluginInterface } from 'graphqldoc'","symbol":"PluginInterface (TypeScript)","correct":"import type { PluginInterface } from 'graphqldoc'"},{"note":"Plugin must be default export; CommonJS module.exports not supported as plugin export.","wrong":"module.exports = MyPlugin","symbol":"Default export (Plugin)","correct":"export default class MyPlugin { /* ... */ }"}],"quickstart":{"code":"npm install -g graphqldoc\n\ngraphqldoc -e http://localhost:8080/graphql -o ./doc/schema\n\ngraphqldoc -s ./schema.graphql -o ./doc/schema\n\ngraphqldoc -j ./schema.json -o ./doc/schema\n\ngraphqldoc -h","lang":"javascript","description":"Install graphqldoc globally and generate documentation from a live endpoint, a schema file, or a JSON introspection result, then view help."},"warnings":[{"fix":"Use `-f` flag to delete existing output directory or ensure it does not exist.","message":"The `-o` (output) directory must not exist unless `-f` (force) is used, otherwise graphqldoc will fail.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure your schema file is valid and exports a GraphQLSchema object (for JS) or is valid IDL/JSON.","message":"Schema file must be parseable by GraphQL.js; for `-s`, it can be .graphql, .js, or .json. For .js, it must export a schema object compatible with graphql-tools.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use graphqldoc instead of graphdoc. Migration: replace `graphdoc` with `graphqldoc` in dependencies and commands.","message":"The original `graphdoc` package is unmaintained; this fork is actively maintained.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Do not modify the schema object directly. If you need to modify, clone it first.","message":"Plugins that mutate the schema object can affect other plugins; all plugins share the same schema reference.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use `-x` to pass headers, e.g., `-x 'Authorization: Bearer token'`.","message":"When using `-e` (endpoint), HTTP headers must be provided via `-x` (header) option; no built-in auth handling.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure you use `-e` when using `-q`.","message":"The `--query` option for querystring parameters is only used with `--endpoint`.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.5.2':10 'api':50 'cli':20 'customiz':42 'doc':58 'document':6,26,48,59 'endpoint':29 'file':31 'fork':13 'generat':4,25 'graphdoc':17,56 'graphql':7,49,55 'graphqldoc':1,57 'html':39 'idl':30 'introspect':35 'javascript':54 'json':36 'live':28 'maintain':12 'modular':32 'output':37 'packag':18 'page':3,40 'plugin':22,45 'project':53 'provid':19 'schema':8,33 'static':2,38 'suitabl':46 'system':23 'templat':43 'unmaintain':16 'version':9","created_at":"2026-06-07T16:54:20.180145+00:00","updated_at":"2026-06-07T16:54:20.180145+00:00","problems":[{"fix":"Add `-f` flag: graphqldoc -e http://... -o ./doc -f","cause":"Output directory specified with `-o` already exists and `-f` not used.","error":"Error: Output directory already exists. Use --force to overwrite."},{"fix":"Verify the schema file exists and is valid: for .graphql, ensure it contains valid SDL; for .json, ensure it is a valid introspection result.","cause":"Schema file is not a valid GraphQL IDL or introspection result, or file is missing.","error":"Error: Cannot read property 'definitions' of undefined"},{"fix":"Use `export default class MyPlugin { ... }` or `export default { ... }` that implements PluginInterface.","cause":"Plugin export is not a default export or does not implement the proper interface.","error":"Error: Plugin must be a constructor or plain object with PluginInterface"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/CodeSignal/graphqldoc#readme","github":"https://github.com/CodeSignal/graphqldoc","docs":null,"changelog":null,"pypi":null,"npm":"graphqldoc","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}