Skip to content

Sphinx for GraphQL: Create beautiful and always-up-to-date GraphQL API documentation websites.

Notifications You must be signed in to change notification settings

graphinx/graphinx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphinx logo
Beautiful, auto-generated API documentation for your GraphQL APIs.

Graphinx logo

Production example

Features

Less noise

Relay integration


Don't pollute your documentation with hundreds of ThingEdge and ThingConnection types. Graphinx will automatically detect them and display them as Connection<Thing>.

Result types


Similarly, Graphinx will detect return types that are unions of a Success type and error types.

Less indirection

Some types are only used in one place. Documenting them somewhere else is unecessary, and makes answering the important question complex: what data can I get on this object?

Graphinx gives template the opportunity to embed types when they are only referenced by a single other type.

Ready for scale

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.

Extensible

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

Getting Started

  1. Add Graphinx to your dev dependencies:

    yarn add --dev graphinx
  2. Initialize a config file

    yarn graphinx init
  3. Follow the instructions given by the CLI ;)

Configuration

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.

Available templates

See graphinx/templates

Creating a new template

See graphinx/templates' contribution guide

About

Sphinx for GraphQL: Create beautiful and always-up-to-date GraphQL API documentation websites.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published