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.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae2ff333d22592365198773d757a34b475ed44ea0979e2c3e35a5b5581e78c4a |
|
MD5 | fbbba33b8ef3f2a6bfd5f52245f4b993 |
|
BLAKE2b-256 | 8b3d76e63144a345933311201b47c9ad090d3b809e179de08391301fa803e558 |
Close
Hashes for graphene_django_query_optimizer-0.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e2fcce164b889706636c61267862988841ba6860f472e3e2cf7c8e179cba7a0 |
|
MD5 | 05815c3153514dbd6b603d45afbd1d6c |
|
BLAKE2b-256 | 10c6fb268410ea021d1bc9140de608d3a2c776ea3c384096549a8483c58ade75 |