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.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c1707379d791e4497d2149969e19cad635bcfc75924b522ab6cc1f53e109c22 |
|
MD5 | 151ee6c417d8b6d6fec9ac6e62babbdc |
|
BLAKE2b-256 | cb6b3d417b6b59892e0ca324bb7457fea47b9534309bea93a32ead004affee31 |
Close
Hashes for graphene_django_query_optimizer-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 270b49752970f6232a20c7c2c13b99670d50aa50f3713e6bb0ec6d75cc516ebb |
|
MD5 | e7e3043cd3c31608b4c4e712c87c38a6 |
|
BLAKE2b-256 | c7498945b96dee50dbb755a50ca02b0932e62a936140985b6472792efe03d70b |