Skip to main content

A Sphinx extension for automatically documenting GraphQL schemas.

Project description

Documentation Github Build Status PyPI Version Supported Python Versions Formatted with Black

A Sphinx extension for automatically documenting GraphQL schemas.

Getting Started

The following steps will walk through how to add autogqlschema to an existing Sphinx project. For instructions on how to set up a Sphinx project, see Sphinx’s documentation on Getting Started.

Installation

autogqlschema can be installed through pip:

pip install autogqlschema

Next, add autogqlschema to the extensions list in your Sphinx project’s conf.py.

extensions.append("autogqlschema")

Usage

Schema documentation is generated from GraphQL schema files using the autogqlschema directive.

In the following example, documentation is generated from ths file structure.

myrepo
├── doc
    ├── conf.py
    └── index.rst
└── src
    └── mypackage
        ├── schema
        │   ├── __init__.py
        │   ├── 01_schema.graphql
        │   └── 02_books.graphql
        └── __init__.py

This schema can be generated with the following reStructuredText:

.. autogqlschema::
   :root-dir: ../src/mypackage/schema
   :source-files: *.graphql

Or:

.. autogqlschema::
   :root-dir: ../src/mypackage/schema
   :source-files: 01_schema.graphql, 02_books.graphql

For more detailed usage, see the documentation: https://autogqlschema.readthedocs.io/en/latest/

Contributing

Running the tests

Tests are executed through tox.

tox

Code Style

Code is formatted using black.

You can check your formatting using black’s check mode:

tox -e format

You can also get black to format your changes for you:

tox -e format -- src/ tests/

Release Notes

Release notes are managed through towncrier. When making a pull request you will need to create a news fragment to document your change:

tox -e release_notes -- create --help

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License. See the LICENSE.rst file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autogqlschema-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

autogqlschema-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file autogqlschema-0.1.0.tar.gz.

File metadata

  • Download URL: autogqlschema-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for autogqlschema-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f15c68e65dc0609e48a6b0a51f2b8f6304f3b882c807eaf2e579e0f1eebe35a5
MD5 9c849d3d83d0d8ea3c6a937b56458c5d
BLAKE2b-256 ea436d52a1535ea33be222dcad7c00ab7e70866a2fdd603ff655c93d8a9adc41

See more details on using hashes here.

File details

Details for the file autogqlschema-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autogqlschema-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10799c0d29e42f613762ac578c90a15dd6801267d6b108becb5b28101a50a846
MD5 d3d6518e69de9d45ca98ccf32bc82f91
BLAKE2b-256 09bee1847de7d0268ada8ea3b9a434f5d685d5c1ec4bb44e5998a35b28f14113

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page