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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7220972d44282366d306f33b057db85681cff6e71d5dfc3feee28e0d77c5087 |
|
MD5 | 6ba4401e7e12388ec6fd06f606a8d20a |
|
BLAKE2b-256 | 530c9e24cdf2905e6bb53977b988d08a3f9032f45f39cc0fe61e3b676df72606 |
Close
Hashes for graphene_django_query_optimizer-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2af5a819015dca96b89f7435238964e1fbece498faeb8fa0472bee4d41d9db4 |
|
MD5 | a7bbfed700f64c287bbb049bb1300d6e |
|
BLAKE2b-256 | cf0accc665fc95db2192cf7fde05f213377145eaa81cbdf1c781c94d67fbf021 |