Automatically optimize SQL queries in Graphene-Django schemas.
Project description
Graphene Django Query Optimizer
pip install graphene-django-query-optimizer
Documentation: https://mrthearman.github.io/graphene-django-query-optimizer/
Source Code: https://github.com/MrThearMan/graphene-django-query-optimizer/
Contributing: https://github.com/MrThearMan/graphene-django-query-optimizer/blob/main/CONTRIBUTING.md
Solve the GraphQL N+1 problem in graphene-django applications
just by changing a few imports, automatically adding the appropriate
only
,
select_related
,
and prefetch_related
method calls to your QuerySets to fetch only what you need.
import graphene
from tests.example.models import Example
from query_optimizer import DjangoObjectType, DjangoListField
class ExampleType(DjangoObjectType):
class Meta:
model = Example
class Query(graphene.ObjectType):
all_examples = DjangoListField(ExampleType)
schema = graphene.Schema(query=Query)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for graphene_django_query_optimizer-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa4fec5cbd41aa64695fd08974943ea75e558837c8788815b898a47576e2587e |
|
MD5 | 9c5f6664c1958f1262b040b3c046d0e9 |
|
BLAKE2b-256 | 52897b1c3abc19e572581ad44c352a4fdbe54b75de791eb8b5fb5d6b1c6bb1d8 |
Close
Hashes for graphene_django_query_optimizer-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28d00f797e07c3dcdb5660b919247360772e5d4d814a6f6259fdafe057ed8e28 |
|
MD5 | cee56b377ec3d86c0141428c1904cb6f |
|
BLAKE2b-256 | 3e77ac078a1a4cdf7862962041e997d584bdbfb031e9b18ed0b0e8a0254752cd |