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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcd0e5490e069e30f0d400ca46bb789892cc537ad548b5e4fb7e278908e09fbc |
|
MD5 | 28c38731e5e6dfafd07996a0df04a445 |
|
BLAKE2b-256 | 061b1d5dcf1bbfe2d428336dfa1a740d6488460c75a0b715bf05830e56efdbbb |
Close
Hashes for graphene_django_query_optimizer-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2bca02f3b9bc67f98dc90eb7799d6538f7589131b87a5d276755242ad788a17 |
|
MD5 | d241025157eb8a6d31e7d39382ab0c54 |
|
BLAKE2b-256 | 453073c9f854ab6eb0c3550a53794ac9e0d46aad5396bb7826e0fc98bcc961f8 |