skillfed

graphene-django

Graphene Django integration

graphene-django v3.2.3 1.2M downloads/30d#4,244 on PyPI4,392
Permissive license MIT Active released

What it is and what it does

Graphene-Django is a bridge library that lets you build GraphQL APIs directly from your Django models without writing boilerplate schema definitions. It sits between Django and graphene, automatically converting your Django model structure into a queryable GraphQL schema and wiring in Django's built-in authentication, permissions, and form validation.

You define your GraphQL types by wrapping Django models in DjangoObjectType classes, then expose them through a schema that graphene-django serves via a Django view. The library handles common tasks like filtering, pagination, and permission checks, so you spend less time on API plumbing and more on business logic. It's designed for developers already working in Django who want to add a GraphQL layer without learning a separate API framework.

Use it for:

  • Expose existing Django models as a GraphQL API without rewriting model definitions or authentication logic
  • Build a modern frontend backed by a Django GraphQL endpoint with automatic schema introspection
  • Add filtering and pagination to Django querysets via GraphQL without custom resolver code
  • Migrate from REST to GraphQL incrementally by wrapping Django views and models in GraphQL types
  • Test GraphQL queries against Django models using the built-in GraphQLTestCase utility

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Graphene-Django bridges Django models and GraphQL APIs, automatically generating GraphQL schemas from Django models and integrating with Django's authentication, permissions, and validation systems.

Yes. Graphene-Django is actively maintained, has no known vulnerabilities, and low install friction. It's the standard choice for adding GraphQL to Django projects. Install it if you're building a GraphQL API on top of Django models and want to avoid manual schema definition and boilerplate.

Install

graphene-django on PyPI

pip

pip install graphene-django

uv

uv add graphene-django

poetry

poetry add graphene-django

Installing graphene-django

Before you install

Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and a large repository (4392 stars), indicating stable, community-backed development.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects without licensing concerns.

Quickstart

pip install graphene-django

# In settings.py:
INSTALLED_APPS = ['graphene_django']
GRAPHENE = {'SCHEMA': 'myapp.schema.schema'}

# In schema.py:
import graphene
from graphene_django import DjangoObjectType

class MyType(DjangoObjectType):
    class Meta:
        model = MyModel

class Query(graphene.ObjectType):
    items = graphene.List(MyType)
    def resolve_items(self, info):
        return []

schema = graphene.Schema(query=Query)

Requires Django to be installed and configured; GraphQL queries execute against your Django ORM, so database setup is a prerequisite.

Verify before relying

  • Performance characteristics under high query load or with large datasets
  • Compatibility with Django versions beyond 4.2
  • Real-world scalability limits for complex nested queries

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 6 — graphene, graphql-core, graphql-relay, Django, promise, text-unidecode
Maintenance actively maintained — 519 days since the last release
Last repo commit
First released
Downloads 1,188,603/month — #4,244 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: graphene_django-3.2.3-py2.py3-none-any.whl

Keywords: api, graphql, protocol, rest, relay, graphene

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.1Framework :: Django :: 4.2Intended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries

Tags

graphql api djangodjango graphql schema generationgraphene django integrationgraphql django modelsdjango graphql authenticationgraphql relay djangodjango graphql filtering
graphqldjango-integrationapi-framework

More Libraries packages