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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 069ee79d8280ff2f504667163901c03cdb5e0fd1062e90946ada2b24b24dd794 |
|
MD5 | 9d37ba9b3b73b497ad8fe01f1f99a315 |
|
BLAKE2b-256 | a101828d6bd12495e1b6b562d8280ea1b714f2a925fbc6698038396862c5ace8 |
Close
Hashes for graphene_django_query_optimizer-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3897f5492fffd0e1af515c121666755d49df31fa181077e38e60702f365f174 |
|
MD5 | d197d34e83552d4df8e977f2ccc98ac5 |
|
BLAKE2b-256 | abe49070cb7318a72f61819c84b37fe32f98e9970497b43a8234e877c2eba767 |