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.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4341d39006c1470e7c6647d60e911dba289c9c9035e17014d8ab947cf071fb8e |
|
MD5 | 4b9cea2fbea3791779d6ae3cf158a639 |
|
BLAKE2b-256 | 1cef59921e8456699ecffa03180460b26b63f5eab9c56d97efec5ccb1f54fc9e |
Close
Hashes for graphene_django_query_optimizer-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc03b2ec74dbfc4d9ed018c80a212c15fa4e47c2faf9d00a4554fe345d0e9997 |
|
MD5 | 0a78b8334996879c2058211ab314327a |
|
BLAKE2b-256 | a5271b8d328aa4ce3981f95587857d1e1565354dd85fe5ae5021a7862b06c6a9 |