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 graphene_django import DjangoListField
from example import ExampleModel
# from graphene_django import DjangoObjectType # old import
from query_optimizer import DjangoObjectType # new import
class ExampleType(DjangoObjectType):
class Meta:
model = ExampleModel
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.1.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 272b356a205ea1fd344646c6c23cd3fbaeba7f0ee00fd6bc1576b22e442e97a3 |
|
MD5 | b960a22fa0cbe4d639d69eada3825692 |
|
BLAKE2b-256 | 1518df58d53dfc6447c18541539acd76f0cbab48d645d26f243a86ee91c8c5cc |
Close
Hashes for graphene_django_query_optimizer-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0648815deae061eeba50c2745c499ab427429328f28aa7f48346db7c13822ef1 |
|
MD5 | f32200287d0da5f74852aa18450be6ac |
|
BLAKE2b-256 | 4ebde8a72b157b3b18f47de9fb4788d4e3791965403d3c44aac56809d26a8e75 |