Skip to main content

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

Project description

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.

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.1.tar.gz (8.9 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.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for graphql_core_promise-3.4.1.tar.gz
Algorithm Hash digest
SHA256 9f1d6148dc3e4a57706f8c957542beb2cf86755e4167f012b747d81efa100e75
MD5 65362b80fdb5624f4dfcf28d70bd4927
BLAKE2b-256 072d02b0ad526ca6da4dfc19acc6875efcbac1534915783c9778ff0f6a86b6d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graphql_core_promise-3.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75db7a229cf5116831e799da5f49514b345791dc429b8b07129bfd121561158a
MD5 55a439a42afbac84aa81dd297236ad1d
BLAKE2b-256 93b04caa797ed80f908753abaf958a6180303d340a1ffc728e48957fe468f20a

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