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.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5013b356d4442458939690ca2e951ff251a058ee44b8e966ff20dde4f2c377c3 |
|
MD5 | d38920bcbfd0369c649c28036032d88c |
|
BLAKE2b-256 | 0909deeb1cac2b98a56af75d4014deb266ed4ab4a2f311ac4e3dd856cf54b498 |
Close
Hashes for graphene_django_query_optimizer-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf3f98077c9fde277dec6eaf2774a49a091a443e2ccb0d695f3c8ecc4555b5a |
|
MD5 | 0fd6cbd22b906ce6740f7701a6978c68 |
|
BLAKE2b-256 | 3d3d81691e0462409da895afe4943575cdb072db76226eb4fb5e60c2475b8fc2 |