Skip to main content

Introduction

GraphQL-Markdown generates Markdown and MDX documentation from a GraphQL schema. You can scaffold a complete Nuxt or Docusaurus site in one command, add the official Docusaurus integration to an existing Docusaurus site, or use the CLI with formatter presets for other supported documentation ecosystems such as Hugo, MkDocs, DocFX, and mdBook.

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​

  • 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​

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.