graphene-pydantic:将GraphQL与您的Pydantic模型集成

时间:2021-05-04 18:41:36
【文件属性】:
文件名称:graphene-pydantic:将GraphQL与您的Pydantic模型集成
文件大小:38KB
文件格式:ZIP
更新时间:2021-05-04 18:41:36
Python 石墨烯-dan 的积分。 安装 pip install " graphene-pydantic " 例子 这是一个简单的Pydantic模型: import uuid import pydantic class PersonModel ( pydantic . BaseModel ): id : uuid . UUID first_name : str last_name : str 要为其创建GraphQL模式,只需编写以下代码: import graphene from graphene_pydantic import PydanticObjectType class Person ( PydanticObjectType ): class Meta : model = PersonModel # exclude
【文件预览】:
graphene-pydantic-master
----.gitignore(803B)
----setup.cfg(110B)
----README.md(8KB)
----.github()
--------workflows()
--------PULL_REQUEST_TEMPLATE(142B)
----graphene_pydantic()
--------converters.py(11KB)
--------inputobjecttype.py(5KB)
--------registry.py(3KB)
--------objecttype.py(5KB)
--------util.py(380B)
--------__init__.py(157B)
----.pre-commit-config.yaml(604B)
----tests()
--------test_objecttype.py(1KB)
--------test_util.py(268B)
--------__init__.py(0B)
--------test_registry.py(2KB)
--------test_graphene.py(3KB)
--------test_inputobjecttypes.py(1KB)
--------test_forward_refs.py(2KB)
--------test_converters.py(5KB)
----examples()
--------__init__.py(0B)
--------departments.py(3KB)
----CONTRIBUTING.md(1KB)
----THIRD_PARTY_LICENSES.md(2KB)
----LICENSE.md(622B)
----pyproject.toml(1KB)
----tox.ini(449B)
----poetry.lock(39KB)

网友评论