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.7.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40f2131c1bc191664d552b0b7de0567a06c53f72ddb6da620ea2337d00cd2308 |
|
MD5 | 947c96f0105d2ee86ab245263425feef |
|
BLAKE2b-256 | e9d6468898e0033980e5502d236ba523c54a0910f9e58470e9e6799f54cd7235 |
Close
Hashes for graphene_django_query_optimizer-0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2abccd2802e444d1b566406626071e81423b3a3af3c8d90d9cd790de0a6867a |
|
MD5 | ae113e97ad0bb3c22c55a75c35ec8fb1 |
|
BLAKE2b-256 | 52843edb36b21d67efc2b4b96594e190f4a13d8c501c1ebba0f419ed9d858a03 |