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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a58aad62da58194c96b906f1ba3c01fce77740dd7585e7d4a0e9332953cb1b3a |
|
MD5 | c00cca53e6c1ad8097970d79fd26688c |
|
BLAKE2b-256 | 4360ab5e11166cabf6fd73c4672b39a8be0d1747a7ce3bfce18de04fce7abaf6 |
Close
Hashes for graphene_django_query_optimizer-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2807a64390abe01953999dab87a9ad7cccecaa1fcc5abb4be2a29097b97aab3e |
|
MD5 | 271f56c5ba7c43021491d625ddcc2dc3 |
|
BLAKE2b-256 | 6f66c8a0622e575f1a3e39f6cbf95771793c7ee63269e24ba446ed4f3d87a0a9 |