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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1770346aade916d7606b67e7a1dc27d5448132e6321eac5b5de4a53dcc5ca5ee |
|
MD5 | b39eba681bbd847bc2753891bdbd3110 |
|
BLAKE2b-256 | 68c361eaf00d5399534213eddcfa12420513d8d61be7dbe43c11eb910a6a04d5 |
Close
Hashes for graphene_django_query_optimizer-0.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7efa94001f061846ab48312c1acc98340abf495bf3724c02bc10fb52d1709766 |
|
MD5 | 27c9eeb5f5fdf51fae5f7675ada0e146 |
|
BLAKE2b-256 | 0079fdf574f472d1dd93bc924a1b5ee8f6043522a61eda793568f2db3fd08caf |