Skip to main content

Add support for promise-based dataloaders and resolvers to graphql-core v3+

Project description

graphql-core-promise

GitHub Workflow Status (main) PyPI PyPI - Python Version License Fellow Careers

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.

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:

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.

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

graphql_core_promise-3.4.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

graphql_core_promise-3.4.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file graphql_core_promise-3.4.2.tar.gz.

File metadata

File hashes

Hashes for graphql_core_promise-3.4.2.tar.gz
Algorithm Hash digest
SHA256 350b5b939832273f7459a1f178046dea28444adb6e983da38eb8b26587e542d6
MD5 3115807b2179ebbcd65595a0a53eb3c1
BLAKE2b-256 f95b95f0be191697fd7830116e8f651b57381b19d01bba194bf643e1f4f8a9cb

See more details on using hashes here.

File details

Details for the file graphql_core_promise-3.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for graphql_core_promise-3.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1283b9dd5c48f71769cb0c5713755d3ccabed3fa18d3f789ffa17afa03239726
MD5 bdf709fa88e9eee7dea2f0ec6da4e9d1
BLAKE2b-256 56d79fad0b4b8362c550d64a760772dbf5d77a8a5d361ab09f43ae3510a97f70

See more details on using hashes here.

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