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.8.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2d90e593e2b14312187b028b22a1df8e484cb1a77c5cb83981de617fd8446a2 |
|
MD5 | 9319864868f374f42b0e0569fbb8c347 |
|
BLAKE2b-256 | 86a08f4f69fd22d93a37aef7451130a9bf84315eb576c5a607333c6aeda6164f |
Close
Hashes for graphene_django_query_optimizer-0.8.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e03bac9dd6318873173e390fd318257642ddf3138204f1f2dc15cc24675727c |
|
MD5 | d8bb506af05c68d4f25e99511086a728 |
|
BLAKE2b-256 | 145985d1d36159796c8854c66904c45cbe71621e6289c571f3aa3b39d5cc2a21 |