0.12.2 • Published 7 months ago

graphinx v0.12.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Production example

Features

Less noise

npm.ioRelay integration Don't pollute your documentation with hundreds of ThingEdge and ThingConnection types. Graphinx will automatically detect them and display them as Connection<Thing>.
npm.ioResult 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.npm.io

Ready for scale

npm.ioBig 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.npm.io 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

0.12.2

7 months ago

0.12.0

9 months ago

0.12.1

9 months ago

0.11.0

11 months ago

0.10.0

11 months ago

0.9.0

11 months ago

0.8.0

11 months ago

0.7.0

11 months ago

1.0.0

11 months ago

0.6.0

11 months ago

0.5.3

11 months ago

0.5.2

11 months ago

0.5.1

11 months ago

0.5.0

11 months ago

0.4.0

11 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago

0.0.6

11 months ago