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 example_project.app.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
File details
Details for the file graphene_django_query_optimizer-0.10.2.tar.gz
.
File metadata
- Download URL: graphene_django_query_optimizer-0.10.2.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8e5676b956f78c9c05cc5abb61001f0d6f60def6ac93ef5498e6bab56497dc |
|
MD5 | ff329202485ea8457cdd59bfb92a4294 |
|
BLAKE2b-256 | 577e2ef295526f5683fd3c8a09550c9d30ba4dae1c12ca91a0e4308cb7374041 |
File details
Details for the file graphene_django_query_optimizer-0.10.2-py3-none-any.whl
.
File metadata
- Download URL: graphene_django_query_optimizer-0.10.2-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7157522a889c8aa78350b8eeff77575af75f163dc77437233ac812ac27fba27e |
|
MD5 | 7053af54d537b1723b053c42e4c1b888 |
|
BLAKE2b-256 | d7f78ca9ee667ccbc8db4ce9a1e750863fea8bcecc000a821ed206e28e9ae4e6 |