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.6.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ef6af646bb5b68a1e23362be9b55233e46c884633fed76837ea004b2fc996f |
|
MD5 | a855d3003c0b0d2084e264c43cc6851d |
|
BLAKE2b-256 | b97d9583df6750abffacc591f77f884bdccc9ae621948c7f907ae425e33deee5 |
Close
Hashes for graphene_django_query_optimizer-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56c50aa2b983f04477e908da318c583915a7c884daa9b41aec3f80cc8dc10851 |
|
MD5 | 499cf3e1ec1dfddd8100faabf0a26e7d |
|
BLAKE2b-256 | a185114a19e96086e1cf405657e5361b591fdf5eec89f7cbfaae4d934f43e01d |