A GraphQL domain for Sphinx.
Project description
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: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 formatting
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file graphqldomain-0.1.0.tar.gz
.
File metadata
- Download URL: graphqldomain-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e6346bad0b3eddb0373ea8856e1b9db30d9bcf860679a2bc304c7955ebb7e69 |
|
MD5 | f6b25a17de504fceb7ed50cc084352a6 |
|
BLAKE2b-256 | d98f60fbbede0d9e81e72e0c068eef094d5919d431f329e1254aa845e6c5346a |
File details
Details for the file graphqldomain-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: graphqldomain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29e78fd3708fa683391d6094a83aa56f01d6f60f93eef51b2e8d302150a48b6e |
|
MD5 | 2c5f521d6335f40f452819501b827acd |
|
BLAKE2b-256 | a4603814e846641a2c55dd7adae11b7e39dcc7f6e73d4cbfb57920f84c6d6957 |