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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d026865e22f80bd9ad07098850505e4b9ea2e7397b9945e74649751c119d21bb |
|
MD5 | ad3723da1ca65b39eafdc7900cb76937 |
|
BLAKE2b-256 | 1ed369c3c1b6875ff1c9c6367ee13919a8ebd86bae44cc682c6715c679676784 |
Close
Hashes for graphene_django_query_optimizer-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4625f54399fe170ce775d33ec4de9e86f01248b05010ec7c01b55af5b40b64cd |
|
MD5 | c93c8b40108042a5bfed8ed850b52014 |
|
BLAKE2b-256 | 8292d4eae3d216ac4d02b815126c6b3ebb72196e96cb33cdc97722788be519df |