Beautiful, auto-generated API documentation for your GraphQL APIs.
Big GraphQL APIs have a lot of types, queries and mutations. Don't let your users read a 10,000-pages-long dump of unrelated, alphabetically-sorted types. With Graphinx, you organize your schema items (types, queries, mutations and subscriptions) into modules. You can define modules manually, or define patterns to auto-categorize your items based on your source code. |
As with the Sphinx documentation tool, Graphinx is template-based: if you want your documentation site to have a unique look, it's really easy to do so. Graphinx essentially processes your schema into data that's ready to use for documentation site generation. Here's an example of what the generated data made available to templates looks like Right now, Graphinx offers a gorgeous default template, and a markdown template, that exports an index markdown file as well as one file per module. |
A template's package.json |
-
Add Graphinx to your dev dependencies:
yarn add --dev graphinx
-
Initialize a config file
yarn graphinx init
-
Follow the instructions given by the CLI ;)
Configuration is done through a .graphinx.yaml
config file. The path to the config file can be changed with --config
.
You can put schema items (types and root fields) into modules by using the @graphinx(module: "module-name")
.
You can define the directive in your schema like this:
directive @graphinx(module: String) on OBJECT | FIELD_DEFINITION | SCALAR | ENUM | UNION | INTERFACE | INPUT_OBJECT
Schema items can also be categorized via the configuration file, see the .graphinx.yaml config file documentation
A JSON schema is available at https://raw.githubusercontent.com/graphinx/graphinx/main/config.schema.json.