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.8.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e962743b9065e2f0859a57e820b01e582689cd26bf7a826d769654ebcd91eb1 |
|
MD5 | 9a0d35006fd7dae21e4326198862be5a |
|
BLAKE2b-256 | d08a02182154d165ee3f6229bdad2a8f90e4bff854a738318a61f9957b2d9c04 |
Close
Hashes for graphene_django_query_optimizer-0.8.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c3370258a182d51da90ff05e345404f6aef82630da19aaf61b6f2a5730c98f1 |
|
MD5 | 6084798c106d84e3fa0076d2120e3d8b |
|
BLAKE2b-256 | f6ee948fb54d711c2fab545e5ad6a19149223f547b9b01224346279b362cb427 |