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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5876d0e09c42774fb9d0f6c5580e198a3aee430ee6e40bef5c0d0ccdbf002375 |
|
MD5 | ce1518ad3b4da213beafa7a5e6edcceb |
|
BLAKE2b-256 | b94a0a3639a31e0c1e06f9e304bae2ce46cd19b37a8eeb83743a60b1952bd79b |
Close
Hashes for graphene_django_query_optimizer-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4ba59aa078760ac66bd78a1971a46e3b7964cc1478c607fcda269a61fe88166 |
|
MD5 | c2eb800e00976aface565430b1bf2cd1 |
|
BLAKE2b-256 | e839408fed2be26f60dcbbbd8fdaf7de1c2c9ee538e6e58ab5a2701dd8c04571 |