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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681f9aeee4771d3f594353fcefd29e96c21a71bd5403e1b90e3e212364ff947a |
|
MD5 | 95069d7b8d3f2c46ee5a0b13d949acca |
|
BLAKE2b-256 | ace01f366ef3e5641697d372e330ee110867b1b890b9b4caf32a397523b16430 |
Close
Hashes for graphene_django_query_optimizer-0.2.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f47bd76c53c3a6810756cb7a5840ed540c6e1ff39fc119fadf20c5f945b6cb |
|
MD5 | 3df24a64efc589466776073f4a7689c6 |
|
BLAKE2b-256 | 95af87b07a22737cab56b1580f609e0a96bee3e041d44c3bfa4da88eaa7a59a0 |