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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e9e901b2d3fcc96ddde6ff224e2a3f564388b90e098ec23fe5fda5fac5d2085 |
|
MD5 | f951cb17b90ab3eb2f246033312489ae |
|
BLAKE2b-256 | 6ccff5d10d6db7fec0a169b8b5895b01c71a1bca24086e6567ac5766d5ed9685 |
Close
Hashes for graphene_django_query_optimizer-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c78c461985b125f1beca4bacdd4618edf3b6324545421e7e73863c2da1cea3 |
|
MD5 | 3d67191f62f12afc0edb5260126d844c |
|
BLAKE2b-256 | 0a9cb11a9b728fbe5cfc748718714c239e5f36b82f84672e1caddd2a9a5d88a2 |