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.2.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ff700a92a8a95b3770f311911e39a6f789202e5f70e9fcd00b03e54191b87ac |
|
MD5 | 9aabbaf54f94af1b8655a6ad37b9e294 |
|
BLAKE2b-256 | 639abe1015bd620106fca3bb25caec544fd0af43ab06c10d36e41a896b251446 |
Close
Hashes for graphene_django_query_optimizer-0.2.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a185572eac27d5392025890f64dc7548ded73d696ce12bab392a521ae756f2fe |
|
MD5 | 227117e3042747a7782e1d9a8908399e |
|
BLAKE2b-256 | 59c936c6d18226f9f738c6d3c00d7ec5b6ee48cc45f7e66c72f55f658b448755 |