Skip to main content

Document your GraphQL API with beautiful static pages

GraphDoc generates clean, static HTML documentation from your GraphQL schema. Support for introspection queries, schema files, and custom plugins.

MIT Licensed
1.5k+ GitHub Stars

Get started in three steps

Generate beautiful documentation for your GraphQL API in minutes

1

Install GraphDoc

Install the CLI tool globally using npm:
npm install -g @2fd/graphdoc
Or use it directly with npx without installation:
npx @2fd/graphdoc --help
2

Generate documentation

Point GraphDoc at your GraphQL endpoint or schema file:
graphdoc -e http://localhost:8080/graphql -o ./docs
Or use a local schema file:
graphdoc -s ./schema.graphql -o ./docs
GraphDoc will generate static HTML files with:
  • Interactive navigation for all types, queries, mutations, and directives
  • Detailed documentation for each GraphQL type
  • Field-level descriptions and deprecation notices
  • Cross-referenced type links
3

Deploy your documentation

The generated documentation is a static site that you can deploy anywhere:
# Deploy to GitHub Pages
git add docs/
git commit -m "Add GraphQL documentation"
git push

# Or serve locally
cd docs && python -m http.server 8000
View live examples: GitHub API, Star Wars, Shopify

Powerful features

Everything you need to create comprehensive GraphQL documentation

Multiple schema sources

Support for HTTP endpoints, JSON files, GraphQL IDL, and JavaScript schema definitions

Plugin system

Extend GraphDoc with custom plugins to add navigation sections, inject content, or modify output

Custom templates

Use Mustache templates to customize the look and feel of your documentation

Static output

Generated HTML is completely static with no runtime dependencies—perfect for hosting anywhere

Type navigation

Automatic navigation organized by types: scalars, enums, interfaces, unions, objects, and inputs

Configuration options

Configure via command-line flags or package.json for seamless integration into your workflow

Ready to document your GraphQL API?

Get started with GraphDoc today and create beautiful, static documentation for your GraphQL schema.