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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10cea9027c7130758422d40d6a60b59acbd2e92ca638bc8ba286795536a85e51 |
|
MD5 | 1d9cfc1ec57af47d10410b89fd2b4294 |
|
BLAKE2b-256 | 7a9662afc849d3d2e054d14b8a1e415e35ab6f83b4ebbbc5e9c5e782413a10b2 |
Close
Hashes for graphene_django_query_optimizer-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afaccaaefdc4503609eb11cbc57f95d3757401ff5a1f8df143e86b746fd68c2f |
|
MD5 | eab3bae6d3956347f63631a0a1922558 |
|
BLAKE2b-256 | 637ca468b24c52f3795bc6e8475cc2c3218809c15ec98ea4d9658de5855234b5 |