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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f987d872fab9f02f44d0c37e34081f5ea26afd0fac6a686567c3d2d71197854 |
|
MD5 | 6e146f565d6386ba23e16571630adec6 |
|
BLAKE2b-256 | 3661768462898db20963e31138dfdfdd691023313cad2d61eff133c821b26cb6 |
Close
Hashes for graphene_django_query_optimizer-0.8.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd7d4eb844770c16f84848d59f485c2d45cd86733f4eceafa67e583c5fc1f896 |
|
MD5 | e2d1fc3d9a6167731b4459feee57e16f |
|
BLAKE2b-256 | 9d90c78de9137f9df05c7f96af7eebb7f51d10ba612b391bd1973935eb5ed405 |