| Name | graphql-core-promise JSON |
| Version |
3.3.0
JSON |
| download |
| home_page | None |
| Summary | Add support for promise-based dataloaders and resolvers to graphql-core v3+ |
| upload_time | 2024-06-03 23:48:13 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.10 |
| license | BSD-3-Clause |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Graphql core promise
Add support for promise-based dataloaders and resolvers to graphql-core v3+. This aims to make migrating to graphene 3 and graphql-core 3 easier for existing projects.
## Usage
This package provides an `ExecuteContext` that can be used as a drop-in replacement for the default one.
```python
from graphql_core_promise import PromiseExecutionContext
from graphql.execution.execute import execute
execute(schema=..., document=..., execution_context_class=PromiseExecutionContext)
```
### With Django
graphene-django's `GraphqlView` accepts a `execution_context_class` argument in the constructor. Or you can specify it as a class variable when subclassing.
For example:
```python
view = GraphQLView.as_view(execution_context_class=PromiseExecutionContext)
# OR
class MyGraphQLView(GraphQLView):
execution_context_class = PromiseExecutionContext
```
Note that this project requires graphene-django 3, which is not fully compatible with graphene-django 2.
### How it works
This packages is done by translating the asyncio code in the default `ExecuteContext` into promise based code.
Raw data
{
"_id": null,
"home_page": null,
"name": "graphql-core-promise",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Samuel Cormier-Iijima <sam@fellow.co>, Shen Li <dustet@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/38/fa/db0ed046ebe21afbc40259e6e87764ed2a4aee25f7dc69a4ca20024b5aee/graphql_core_promise-3.3.0.tar.gz",
"platform": null,
"description": "# Graphql core promise\n\nAdd support for promise-based dataloaders and resolvers to graphql-core v3+. This aims to make migrating to graphene 3 and graphql-core 3 easier for existing projects.\n\n## Usage\n\nThis package provides an `ExecuteContext` that can be used as a drop-in replacement for the default one.\n\n```python\nfrom graphql_core_promise import PromiseExecutionContext\nfrom graphql.execution.execute import execute\n\nexecute(schema=..., document=..., execution_context_class=PromiseExecutionContext)\n```\n\n### With Django\n\ngraphene-django's `GraphqlView` accepts a `execution_context_class` argument in the constructor. Or you can specify it as a class variable when subclassing.\n\nFor example:\n\n```python\nview = GraphQLView.as_view(execution_context_class=PromiseExecutionContext)\n# OR\nclass MyGraphQLView(GraphQLView):\n\texecution_context_class = PromiseExecutionContext\n```\n\nNote that this project requires graphene-django 3, which is not fully compatible with graphene-django 2.\n\n### How it works\n\nThis packages is done by translating the asyncio code in the default `ExecuteContext` into promise based code.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Add support for promise-based dataloaders and resolvers to graphql-core v3+",
"version": "3.3.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "23a562b373740148ef6949d1256778c0445fbbb280f5a5e9b99383d29ba709c9",
"md5": "fe1668cfa708bd189bbb9ebdf4914eb9",
"sha256": "bfa8aa64440fa2e1938fb0085b362c80ba3d09ebfbcf5c27a6ed92beec7797ff"
},
"downloads": -1,
"filename": "graphql_core_promise-3.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fe1668cfa708bd189bbb9ebdf4914eb9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7341,
"upload_time": "2024-06-03T23:48:09",
"upload_time_iso_8601": "2024-06-03T23:48:09.033534Z",
"url": "https://files.pythonhosted.org/packages/23/a5/62b373740148ef6949d1256778c0445fbbb280f5a5e9b99383d29ba709c9/graphql_core_promise-3.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "38fadb0ed046ebe21afbc40259e6e87764ed2a4aee25f7dc69a4ca20024b5aee",
"md5": "bf646b1bec74076e2053d74551025fa6",
"sha256": "6e4ec6b638d0723dc5bb1d86f33feed581e6be1170be3de58b53f4cbe267e676"
},
"downloads": -1,
"filename": "graphql_core_promise-3.3.0.tar.gz",
"has_sig": false,
"md5_digest": "bf646b1bec74076e2053d74551025fa6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 10723,
"upload_time": "2024-06-03T23:48:13",
"upload_time_iso_8601": "2024-06-03T23:48:13.182296Z",
"url": "https://files.pythonhosted.org/packages/38/fa/db0ed046ebe21afbc40259e6e87764ed2a4aee25f7dc69a4ca20024b5aee/graphql_core_promise-3.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-03 23:48:13",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "graphql-core-promise"
}