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.7.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddc0fa521b9a03cc2a205aabb9f94f6c5a6dafc8f38df0c3e474a9345229aa2e |
|
MD5 | ef7a15e036ebe0ad0c348a593c99dfbd |
|
BLAKE2b-256 | 1c38cf6daad6d1db063548d2cb835c1ce0c86c80a1a00c8ec7f94fd345bdb40b |
Close
Hashes for graphene_django_query_optimizer-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4057daecade7a75654d9c38fcde68c513f0b45c45ae8ef3a6c474dce88859543 |
|
MD5 | 2c1b7ea16552d0846fcb63b951175c43 |
|
BLAKE2b-256 | 3644e6f8086ddd0e7419b36088c22da8667d6f16971544eed0f08a93fdf66dca |