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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b36b10a07e72b7bfb3f8311ef33f867579f5cb6929508c6716d445322014b5b4 |
|
MD5 | c672c744cbfb71965b0beb573389c44b |
|
BLAKE2b-256 | 1b01de936fb07f586d7bb90deb73bb0eb44b0e0c0f7d1c0faba3d8ba36756c54 |
Close
Hashes for graphene_django_query_optimizer-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e9c06d4a0b3d833d42cda995e16b62b23c459b86b74d506be7ad298e6b632a4 |
|
MD5 | 613e9136c97169f81ff9a0a24015b8b4 |
|
BLAKE2b-256 | 8d2a54583663e8a8970dc934ae8e8f8afa8cee5cf7b5de277e39f026497f41de |