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.5.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 063559786529136ecf379aea1ca6885aac99c624f0da06a14bb50f9468ef4a23 |
|
MD5 | 9d4dda6bcacdcfbbdfca0de6f8db5f26 |
|
BLAKE2b-256 | a08106eb6a35afd20b22409d5ac180e722c54e59ed352bf074d365c209b67923 |
Close
Hashes for graphene_django_query_optimizer-0.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20dd491dc10b7a9f06c81027f4d6ef6b62a239a3ab5334d91f69b06ad7cebdb3 |
|
MD5 | 72654f33873f6812f33ffa4e6dabf09b |
|
BLAKE2b-256 | 1990730b77b53879a8157cdefaa132a49870ef2ba590d2289a6daa396f202af2 |