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:Load schema
GraphDoc connects to your GraphQL endpoint or reads your schema file and runs an introspection query to extract the complete type system
Process with plugins
The schema data passes through configured plugins, which can modify navigation, add sections, inject assets, or customize headers
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
Supported schema formats
GraphDoc can generate documentation from multiple schema sources:GraphQL HTTP endpoint
GraphQL HTTP endpoint
Point GraphDoc at any GraphQL endpoint that supports introspection. You can include custom headers and query parameters for authentication.
JSON introspection file
JSON introspection file
Use a pre-generated introspection query result saved as JSON. This is useful for version control or when introspection is disabled in production.
GraphQL IDL files
GraphQL IDL files
Parse GraphQL Schema Definition Language files (.graphql, .gql, .graphqls, .gqls).
JavaScript schema modules
JavaScript schema modules
Load schema from JavaScript files that export a GraphQL schema object (useful for modularized schemas using graphql-tools).
Example output
GraphDoc has been used to document several well-known GraphQL APIs:- GitHub V4 API - Complete documentation of GitHub’s GraphQL API
- Shopify API - Shopify’s extensive e-commerce API
- Pokemon GraphQL - Pokemon data API documentation
- Star Wars API - The classic GraphQL example