Skip to main content
GraphDoc is a command-line tool that automatically generates static HTML documentation from GraphQL schemas. It transforms your GraphQL API schema into a browsable, searchable documentation site with zero configuration required.

What is GraphDoc?

GraphDoc takes your GraphQL schema—whether from a live endpoint, an introspection JSON file, GraphQL IDL files, or JavaScript schema definitions—and generates a complete static documentation website. The tool parses your schema and creates individual pages for each type, directive, field, and argument, making your API easy to explore and understand.

Key features

GraphDoc provides several powerful features that make it ideal for documenting GraphQL APIs:

Multiple input sources

Generate documentation from live GraphQL endpoints, JSON introspection files, GraphQL schema files (.graphql, .gql), or JavaScript schema modules

Zero configuration

Works out of the box with sensible defaults—just point it at your schema and go

Plugin system

Extend functionality with plugins to customize navigation, document sections, headers, and assets

Custom templates

Use the default Salesforce Lightning Design System template or create your own using Mustache

Static output

Generates static HTML files that you can host anywhere—GitHub Pages, Netlify, S3, or any web server

Rich schema display

Automatically displays types, fields, arguments, directives, deprecations, and descriptions from your schema

When to use GraphDoc

GraphDoc is the right choice when you need to:
  • Document public APIs: Create comprehensive documentation for external developers consuming your GraphQL API
  • Internal API documentation: Help your team understand and explore internal GraphQL services
  • Version control documentation: Generate documentation as part of your CI/CD pipeline and track changes over time
  • Offline documentation: Provide documentation that doesn’t require a live server or internet connection
  • Custom documentation sites: Build on top of GraphDoc’s plugin system to create tailored documentation experiences
GraphDoc uses the standard GraphQL introspection query to extract schema information. Make sure introspection is enabled on your GraphQL endpoint if you’re generating documentation from a live API.

How it works

GraphDoc follows a simple three-step process:
1

Load schema

GraphDoc connects to your GraphQL endpoint or reads your schema file and runs an introspection query to extract the complete type system
2

Process with plugins

The schema data passes through configured plugins, which can modify navigation, add sections, inject assets, or customize headers
3

Generate static files

GraphDoc renders HTML pages using Mustache templates, creating one page per type/directive plus an index page, along with all necessary assets

Architecture

GraphDoc is built with TypeScript and uses several key technologies:
  • GraphQL.js: For schema introspection and parsing
  • Mustache: Template rendering engine
  • Salesforce Lightning Design System: Default UI components and styling
  • Plugin architecture: Modular design for extensibility
The generated documentation is completely static—no server-side rendering or JavaScript frameworks required. This makes it fast, secure, and easy to host.

Supported schema formats

GraphDoc can generate documentation from multiple schema sources:
Point GraphDoc at any GraphQL endpoint that supports introspection. You can include custom headers and query parameters for authentication.
graphdoc -e https://api.example.com/graphql -o ./docs
Use a pre-generated introspection query result saved as JSON. This is useful for version control or when introspection is disabled in production.
graphdoc -s ./schema.json -o ./docs
Parse GraphQL Schema Definition Language files (.graphql, .gql, .graphqls, .gqls).
graphdoc -s ./schema.graphql -o ./docs
Load schema from JavaScript files that export a GraphQL schema object (useful for modularized schemas using graphql-tools).
graphdoc -s ./schema.js -o ./docs

Example output

GraphDoc has been used to document several well-known GraphQL APIs:
GraphDoc requires Node.js and npm to be installed. The tool generates files based on your schema structure, so large schemas will produce more files and may take longer to generate.

Build docs developers (and LLMs) love