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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c2c1ef83b27e95b897798054b607dbd5708d0e1b51902f60ba811658cc3a0f0 |
|
MD5 | 250e69617c60b642a55353f84f1c3321 |
|
BLAKE2b-256 | 4769e9d865cbad23b90f92edb1de6bfe95b8668d6d388d23084d6e5ed4f7f1af |
Close
Hashes for graphene_django_query_optimizer-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6048df23915569a49d3692a90d8360b8d51d1d7f82830646dd14b0ffc3fcd639 |
|
MD5 | 8bb895737da098515a3014ff9962688f |
|
BLAKE2b-256 | 7c2b712ec118133be9aa5247e9711b3ed454fabf7aac3c381da34d2f05a7f928 |