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.0.tar.gz (11.0 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.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graphql_core_promise-3.4.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for graphql_core_promise-3.4.0.tar.gz
Algorithm Hash digest
SHA256 ff52a4437def3b0f822da9cce67adecb9e8f7e543a3b78a79e16cb436b6e47a1
MD5 9ee94fd9a196f2e2844eee0e15fed646
BLAKE2b-256 1e60078def376197a5de737769e0f9e299e79db55ae0a7c6818732c4360b3907

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphql_core_promise-3.4.0.tar.gz:

Publisher: release.yml on fellowapp/graphql-core-promise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for graphql_core_promise-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5d6a80df6347aedfdf28f29d14233db6660738d172774f6b2c950020edbb0ee
MD5 70204e19f51cefec50a3026bfc70d025
BLAKE2b-256 21f8e8796bb5397eaed12cc929ef3a457fe4766bb5abbef8a860bf0717c72d3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphql_core_promise-3.4.0-py3-none-any.whl:

Publisher: release.yml on fellowapp/graphql-core-promise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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