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.5.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b41f1e288ebe3d67ef78a8584fa9c0c070cd82dce75bb4c37bd86280236b59a |
|
MD5 | 57a6f6d1ec7fbc8a5edb6d309f7f4024 |
|
BLAKE2b-256 | 05c491470debd8c3bc8779217bc1e1cf0a4c777d4cc55ff3b9a1b2fb54d1d0b0 |
Close
Hashes for graphene_django_query_optimizer-0.5.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 631091911be5a4c8c2ee37f7c4484e2a916c9fc58e47940f75e35d21304ff74a |
|
MD5 | a7be6e7d3a501c0a6d15e3523b581b05 |
|
BLAKE2b-256 | 156827a028f7f2bef4db2de3b7b7f309198ad0d53f2a062ebd3261d2d67cc9b9 |