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 graphene_django import DjangoListField
from example import ExampleModel
# from graphene_django import DjangoObjectType # old import
from query_optimizer import DjangoObjectType # new import
class ExampleType(DjangoObjectType):
class Meta:
model = ExampleModel
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.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8687abff712ddda09525251e2bd844b7aec5b1dd8d6c37c1ae3235a35231e54 |
|
MD5 | 5f141ccdf3617c95fd6a477767c9306e |
|
BLAKE2b-256 | 08496e99235a211f20d214e4847086d0a7c9beedf67aa007c8141466d11c16ab |
Close
Hashes for graphene_django_query_optimizer-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 611adb05a9a45ae22afc59c2af4eaf0aa901842e735605b6cad41a9dc1944aa0 |
|
MD5 | bc95d356a3935802c1c6429d98751cf8 |
|
BLAKE2b-256 | d53fadc638cb7b38c5086ca3c59e684b56b6c846dbfc74d3fc3869f68a6c83c8 |