Document a GraphQL API

Francisco Canela picture Francisco Canela · Sep 15, 2016 · Viewed 31.2k times · Source

With REST we can use Swagger, RAML or other technologies to document our API and generate an HTML documentation that our consumers can read without any need of interaction with the servers.

Does something similar exist for GraphQL? Is there any way to generate a documentation of resources and properties?

Answer

jun picture jun · Oct 31, 2016

It looks like there is now https://www.npmjs.com/package/graphql-docs

Dynamically generated documentation explorer for GraphQL schemas. It aims to provide a better overview of a schema than GraphiQL, but without querying features.

enter image description here

You can also generate a static documentation file based on a schema file or GraphQL endpoint:

npm install -g graphql-docs
graphql-docs-gen http://GRAPHQL_ENDPOINT documentation.html