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.6.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0376e33d232a7b5d3cfcb6a2ce4f3bafa62a01e49cdaf055ab06c586d5a44508 |
|
MD5 | 68a7d21337f7a1353d8674cd0e33138b |
|
BLAKE2b-256 | 8f124e6d28cb30649ae4e1be60d6b7548c18c7dd3abf1ae3e844869f19366293 |
Close
Hashes for graphene_django_query_optimizer-0.6.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6264b9abfad56b2b04a77e5aefef09ca5b26a6148327f21076fb8e795da83e4b |
|
MD5 | c3080802ad960509a9b45e6663707cb1 |
|
BLAKE2b-256 | 2670e18e257c041a287ad95fd78a77d53051bfff859c340757ebeac285c9edc1 |