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.4.tar.gz
.
File metadata
- Download URL: graphene_django_query_optimizer-0.10.4.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 053432d6f39985ce99ac24851d88a2a13495fe11ca991be6a1e65e9e1385d038 |
|
MD5 | 89c5983651dfa9d589e472b7e28a2e47 |
|
BLAKE2b-256 | f204ae2baca46e72fe1c033c40b0297a2d007c32d2aad0a3e4ad295b780d2d38 |
File details
Details for the file graphene_django_query_optimizer-0.10.4-py3-none-any.whl
.
File metadata
- Download URL: graphene_django_query_optimizer-0.10.4-py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e0e5e9f5587fe286ad804ad66f4737bf79a4d1d076d49b24d6ae95c27d0eeee |
|
MD5 | 3269cc2d2854605221e5cadfe87eef99 |
|
BLAKE2b-256 | e797f7bb87d971e2e66f219973fdb63188b370311136e456d1f737c1501167ad |