graphql-docs is a Ruby gem that automatically generates beautiful, static HTML documentation from your GraphQL schema. No manual documentation writing required!
It creates comprehensive, searchable documentation for all your types, queries, mutations, and fields - making it easy for developers to understand and use your GraphQL API.
Generate complete API documentation from your GraphQL schema with a single command
Clean, professional documentation with syntax highlighting and responsive layout
Find types, fields, and operations quickly with built-in search functionality
Deploy anywhere - GitHub Pages, S3, CDN, or serve from your app
Custom templates, landing pages, and styling options
Documents all types: objects, queries, mutations, scalars, enums, interfaces
gem "graphql-docs", "~> 5.0"
desc "Generate GraphQL documentation"
task :docs do
require "graphql-docs"
GraphQLDocs.build(
schema: YourSchema,
output_dir: "./docs",
delete_output: true,
base_url: "/docs"
)
end
bundle exec rake docs
That's it! You now have comprehensive, searchable documentation for your entire GraphQL API.
This is a complete working example showing how to integrate graphql-docs into a Ruby GraphQL application. It includes:
Rakefile:40-54
)This demo provides a GraphQL API for classic books. Try out some queries below to see the API in action, then check out the generated documentation to see how graphql-docs documents it.
Results will appear here...