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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3926c55f82ead9e75fd8c927fb68e27f8019ddc3e5b2f8a44b6aa9dc080d3927 |
|
MD5 | 9ad3ffd66a7e5035d8f349942e29556f |
|
BLAKE2b-256 | e1c84eab81f927e4c0408def44cc8325df364dfcecd33e1f3a853b84dae7447a |
Close
Hashes for graphene_django_query_optimizer-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14c3d919b1671db6a37412d2df844ea571299dd5666d51d5939ab7a794e9f94e |
|
MD5 | 131df889f2fcd4c1ea0afc1570de2a55 |
|
BLAKE2b-256 | a29a25d3185ab795f4b6802574794ebcef84da179f2e88ec8ba37e22e4eb3a90 |