<h1 align="center"Flexible documentation for GraphQL schemas</h1
GraphQL-Markdown
Generate Markdown and MDX documentation from GraphQL schemas for Docusaurus and other supported documentation ecosystems.
Installation
GraphQL-Markdown supports two main setup paths:
- use the official Docusaurus integration for Docusaurus sites
- use the CLI with formatter presets for other supported ecosystems such as Hugo, MkDocs, DocFX, and mdBook
Choose your preferred package based on your documentation stack:
# For Docusaurus sites
npm install @graphql-markdown/docusaurus graphql
# For formatter-based setups
npm install @graphql-markdown/cli @graphql-markdown/formatters graphqlUsage
Docusaurus Plugin
Add to your docusaurus.config.js:
module.exports = {
plugins: ["@graphql-markdown/docusaurus"],
};Run the generation command:
npx docusaurus graphql-to-docCLI Usage
Use the CLI directly for custom workflows, or pair it with @graphql-markdown/formatters to adapt the generated output for supported frameworks.
npx gqlmd graphql-to-doc --schema ./schema.graphql --output ./docsFor formatter-based setups: