Introduction
GraphQL-Markdown turns a GraphQL schema into API documentation in two ways:
- A standalone API reference site. Scaffold a complete site in one command with the Nuxt theme. It shows one page per type, or the whole API as a single three-column page. You can also scaffold a Docusaurus site.
- Markdown and MDX for your docs framework. Add the official Docusaurus integration to an existing site, or use the CLI with formatter presets for Hugo, MkDocs, DocFX, mdBook, and other ecosystems.
Why GraphQL Markdown?
Managing API documentation can be time-consuming and prone to becoming outdated. This package solves these challenges by:
- Automatically generating documentation from your schema
- Keeping documentation in sync with your API
- Providing a consistent documentation structure
- Integrating with Docusaurus, Nuxt, and supported formatter-based documentation ecosystems
Features
- Standalone API reference site with the Nuxt theme, multi-page or single-page
- Easy set up and customizable output
- Full cross-linking between types with visual relationship hierarchy
- MDX output fully customizable using your own components
- Extensible lifecycle hooks and events system
- Any schema loader compatible with
@graphql-tools/load— SDL files, remote endpoints, or code-first TS/JS schemas - Group types into categories using directives
- Namespaced operations (nested query/mutation/subscription objects)
- GraphQL config support
Quick install
- New site
- Existing Docusaurus site
- Other frameworks
The recommended start is the scaffolder, which creates a new site (Nuxt by default, or Docusaurus):
npm create graphql-markdown-docs@latest
See Getting started for the prompts and flags, and Nuxt Theme for the Nuxt layer it uses.
To add to an existing Docusaurus site instead:
npm install @graphql-markdown/docusaurus graphql
For formatter-based setups (Hugo, MkDocs, DocFX, mdBook, Astro, Next.js, etc.):
npm install @graphql-markdown/cli @graphql-markdown/formatters graphql
For the full list of supported formatter presets, see Integration with Frameworks.