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.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74162f5f42690496ccc8adf733f89ca5c5e58eaf6df89a33d43111894fb8d69 |
|
MD5 | b0b0a187125567b61a8df43f80295b3e |
|
BLAKE2b-256 | 17f3f5216ae876101f95035c33c3307210b0b96b9224821c455a04725880c33d |
Close
Hashes for graphene_django_query_optimizer-0.2.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d06a76a894b733c8aa1d93b671f3220544a37b211e25e0e5ea94497a15b5380 |
|
MD5 | 7925171d36646e6e5f4a6d93b48d3e3e |
|
BLAKE2b-256 | 5934d828274b20750ca01e18515e311d514e48747b5ac7d54e315535f26f72a5 |