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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 791bd01869506c9e22384a87010e2563521f4173a3c36446425ec3b6defa9c36 |
|
MD5 | 53ed65c4b8f5fe2e363d8b0cf3f2c5ac |
|
BLAKE2b-256 | 3052e388141c2340e5c43ae2cfca67cecd3c77ef55cc6a8f46440fd2eeeeaada |
Close
Hashes for graphene_django_query_optimizer-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7cb4a9603fca84c8757091be3c49cc673036a969cb1dc3c3a58e99daf568cb |
|
MD5 | 665312f4be01d87cd3f52058a150bff1 |
|
BLAKE2b-256 | 4a1edbb93cc81f9378b39959eb8340fb06bbd34a2d862115742760c51eddd873 |