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.3.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a52a5dcc4108405d3cd8e53cc32e8f38b43ba6ebacab828738f98357aa945d6 |
|
MD5 | 81988d075055a67dadc7539e07a88922 |
|
BLAKE2b-256 | f04330a6e9ee27c1d224186f0a7df4c90bb2c8874f5e4e2d1f0abf6c0d0e1edc |
Close
Hashes for graphene_django_query_optimizer-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25da7bb054fbd4cbdfd7126f617786ff9cd5ebdb0db3363414b75f7d52d60aee |
|
MD5 | 110a53dd1a122210e6ccf85c8d869c53 |
|
BLAKE2b-256 | 1ec46176c607ad4b23505c24625040d592a99236c4a5a6b5e0f6b98cac199df1 |