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.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac854a7e47c47b33d60bdb107963491f0051c60b6809c40c9f879659ecf3e708 |
|
MD5 | 2f0cca7d17fbfabada012b06b7abeed8 |
|
BLAKE2b-256 | 02fcb9c7142c40de9d40294705930390defdbbef4bdaef63d47e0c3cf337c3af |
Close
Hashes for graphene_django_query_optimizer-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3db6c3cd4e46db4ee1646441d14912b844452e0e933d1f7b6a6ece8364b31a |
|
MD5 | 64959aa63818e9fa441f328242edd557 |
|
BLAKE2b-256 | e531e57fdabe3bc5d06065401748f1ae790aabedc6a352f9f9fdbec58a64e452 |