Skip to main content

A GraphQL domain for Sphinx.

Project description

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

A Sphinx domain for describing GraphQL schemas.

Getting Started

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

Installation

graphqldomain can be installed through pip:

pip install graphqldomain

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

extensions.append("graphqldomain")

Usage

Each directive accepts a small snippet of the original schema. For more detailed usage, see the documentation: https://graphqldomain.readthedocs.io/en/latest/

.. gql:schema::

   An example schema.

   :optype Query query:

   .. gql:directive:: @slow(super: Boolean = false) on FIELD_DEFINITION | ARGUMENT_DEFINITION

      Indicates that the usage of this field or argument is slow,
      and therefore queries with this field or argument should be made sparingly.

      :argument super: Whether usage will be super slow, or just a bit slow.

   .. gql:enum:: CharacterCase

      The casing of a character.

      .. gql:enum:value:: UPPER

         Upper case.

      .. gql:enum:value:: LOWER

         Lower case.

   .. gql:input:: Point2D

      A point in a 2D coordinate system.

      .. gql:input:field:: x: Float

         The ``x`` coordinate of the point.

      .. gql:input:field:: y: Float

         The ``y`` coordinate of the point.

   .. gql:interface:: NamedEntity

      An entity with a name.

      .. gql:interface:field:: name(lower: Boolean = false): String

         The name of the entity.

         :argument lower: Whether to lowercase the name or not.

   .. gql:type:: Person implements NamedEntity

      A human person.

      .. gql:type:field:: age: Int

         How old the person is in years.

      .. gql:type:field:: picture: Url

   .. gql:union:: Centre = Person | Point2D

      A possible centre of the universe.

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:

black graphqldomain.py tests/

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

graphqldomain-1.0.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

graphqldomain-1.0.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for graphqldomain-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0c9bc063218c10d397386e1b1b0f2a6d7f153d6f8ab7f9ead0ca7da333ccb2a2
MD5 4e3cb180067f9c9d47e0ad0e392602b6
BLAKE2b-256 aea5cefeb35509b74133fbbc5f0116d588b773ee46cf437dc4bd5e4fcd36d939

See more details on using hashes here.

Provenance

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

Publisher: release.yml on AWhetter/graphqldomain

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

File details

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

File metadata

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

File hashes

Hashes for graphqldomain-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7394fe380846f2cee5c4feb5bf41fc8b78cb46effdbc3e99a72d207b92d2f43d
MD5 198fdf0ce3981922dd62db1049d7eb63
BLAKE2b-256 f57e7e3656fc03cfb2213cd0505fbf87efcc2467792cfe168915652b5448f918

See more details on using hashes here.

Provenance

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

Publisher: release.yml on AWhetter/graphqldomain

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