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.4.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52f208eda77916e7ac33615a4ac94b8d94e7a7005db08fbeed4cddbf271f673a |
|
MD5 | 1153860ecb82e386aed451a34ddb8f81 |
|
BLAKE2b-256 | 80160de93553cc50db48461f7156c553462c5f05c888899229e910b1405c4c11 |
Close
Hashes for graphene_django_query_optimizer-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e6ed308e07db9575fc139fcdbb8c29fcab30e742d8b88ea21ced3d73103ab0 |
|
MD5 | 471232bbbc1c422a4656a0b6f6e36703 |
|
BLAKE2b-256 | d91490803a34b06e47e44d04e6bfdb96cbc4565a24a0ce8ca8b3c1fff7a9ff23 |