Skip to main content

Automatically optimize SQL queries in Graphene-Django schemas.

Project description

Graphene Django Query Optimizer

Coverage Status GitHub Workflow Status PyPI GitHub GitHub Last Commit GitHub Issues Downloads Python Version

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

graphene_django_query_optimizer-0.1.10.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file graphene_django_query_optimizer-0.1.10.tar.gz.

File metadata

File hashes

Hashes for graphene_django_query_optimizer-0.1.10.tar.gz
Algorithm Hash digest
SHA256 ad93614a453f6d5e11cbeddc69366a44729561ef4b7c7b6e439ba5cf784b6a5b
MD5 c8b672b302fb0239c0f0dbc24b17d7ad
BLAKE2b-256 29c66c64b0c9f2f68f01f1d45f188bba48a2e2fc7da4d429a35b34c99012a40c

See more details on using hashes here.

File details

Details for the file graphene_django_query_optimizer-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for graphene_django_query_optimizer-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 1efcd96e6d405f285cb85107817b69d3e3c1228af29ee6d867a490490cbdd55b
MD5 a0c45caa4751707de5f846f1904e9b5e
BLAKE2b-256 0d5dadf3bff294074876b6c3feecfff4300643ef4992a6016bddffccb81681b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page