Sphinx的GraphQL域。
项目描述
一个用于描述GraphQL模式的Sphinx域。
入门
以下步骤将说明如何将graphqldomain添加到现有的Sphinx项目中。有关如何设置Sphinx项目的说明,请参阅Sphinx的入门文档。
安装
graphqldomain可以通过pip安装
pip install graphqldomain
接下来,将graphqldomain添加到Sphinx项目中的extensions列表中的conf.py。
extensions.append("graphqldomain")
用法
每个指令都接受原始模式的片段。有关更详细的用法,请参阅文档: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.
贡献
运行测试
测试通过tox执行。
tox
代码样式
代码使用black格式化。
您可以使用black的检查模式检查您的格式化
tox -e format
您也可以让black为您格式化更改
black graphqldomain.py tests/
版本控制
许可证
此项目受MIT许可证的许可。有关详细信息,请参阅LICENSE.rst文件。
项目详情
关闭
graphqldomain-0.2.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 59d5f9269e513d2c55be47ed86088ecd9cfbdd0a44df8c77c71821550d52385c |
|
MD5 | 4a3f2ca2640c2beb0e2f3bcf6db08b5c |
|
BLAKE2b-256 | 71f1f09d438ba09d8e4bf561f02d42549751cc5db616468f74e669b3c89bd286 |
关闭
graphqldomain-0.2.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e9c813a670cb6db9492b8b63e8fff54a0e0a522f49ea35d2bc9bf52acbaa641e |
|
MD5 | 6c663d255fa8ebe7341ae55bf4d10431 |
|
BLAKE2b-256 | 0655d0165a60072c7886f9a296a10f31103fff795ce3d340b51e7b25712fcaca |