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-1.0.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autogqlschema-1.0.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autogqlschema-1.0.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for autogqlschema-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8d51fdf2a1ae9c165aa4fed72ce409f13ded8c899c88acf979259d0fc5ed5144
MD5 9e73a55bd1e4a2676900ad812594ebd0
BLAKE2b-256 2544a087f3f219a290114d01f8b90a372fa847a50f312475553bb1dae66dfc13

See more details on using hashes here.

Provenance

The following attestation bundles were made for autogqlschema-1.0.0.tar.gz:

Publisher: release.yml on AWhetter/autogqlschema

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: autogqlschema-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for autogqlschema-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ba38a44470c7fa05f51de741d5bd2dcf94d28ac2f67968902e995239059493e
MD5 1a01235136ea9e01f6a74d338b9b46a5
BLAKE2b-256 ff6626d86577972f1884fd0a4d67033fec46ff54aff17ecf813e0a5d1c9413a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for autogqlschema-1.0.0-py3-none-any.whl:

Publisher: release.yml on AWhetter/autogqlschema

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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