strawberry-graphql-django
Strawberry GraphQL Django extension
What it is and what it does
Strawberry GraphQL Django bridges Django models and GraphQL APIs by automatically generating GraphQL types, fields, and resolvers from your model definitions, eliminating boilerplate type definitions. The package includes built-in support for filtering, pagination (both offset and cursor-based), ordering, and Django's authentication and permission system. It also includes a query optimizer that automatically applies select_related and prefetch_related to prevent N+1 database queries.
You define your Django models normally, apply decorators, and the package generates a working GraphQL schema. It integrates with Django views (both sync and async), forms, and validation. The result is a GraphiQL interface at a URL you specify, ready to query your data with full type safety and optimized database access.
Use it for:
- Build a GraphQL API from an existing Django application without rewriting model definitions.
- Generate CRUD mutations automatically for Django models with built-in validation.
- Implement filtering and pagination on GraphQL queries backed by Django ORM queries.
- Prevent N+1 database queries in GraphQL resolvers using automatic query optimization.
- Expose Django authentication and permission checks in a GraphQL schema.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates GraphQL types, queries, mutations, and resolvers automatically from Django models with full type safety, including filtering, pagination, ordering, and N+1 query prevention.
Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a real problem—bridging Django models to GraphQL without manual type duplication. It supports current Python versions and includes practical features (query optimization, pagination, permissions) that would otherwise require custom code. No known vulnerabilities. Suitable for both new GraphQL projects and retrofitting GraphQL onto existing Django applications.
Install
strawberry-graphql-django on PyPI
pip
pip install strawberry-graphql-djangouv
uv add strawberry-graphql-djangopoetry
poetry add strawberry-graphql-djangoInstalling strawberry-graphql-django
Before you install
Low friction install with a pure-Python wheel. Actively maintained with a release 8 days old and recent commits; the project has 501 GitHub stars and supports current Python versions.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install strawberry-graphql-django
from django.db import models
class Fruit(models.Model):
name = models.CharField(max_length=20)
# In types.py, decorate your model with the integration
# Then import and use in your schema with strawberry-graphql
Requires Django 5.2 or 6.0 and Python 3.10 or later; asgiref and strawberry-graphql are runtime dependencies.
Verify before relying
- Whether the automatic query optimizer works for all relationship types without manual tuning.
- Performance characteristics when handling large datasets or deeply nested queries.
- Compatibility with custom Django model managers or non-standard ORM patterns.
- Exact syntax and import patterns for the decorator-based type generation workflow.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — asgiref, django, strawberry-graphql |
| Maintenance | actively maintained — 8 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,365,443/month — #3,999 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: strawberry_graphql_django-0.87.0-py3-none-any.whl
Keywords: api, django, graphql, strawberry-graphql
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
strawberry-graphqlStrawberry GraphQL is a Python library for…
permissive · top 5,000 on PyPI
graphene-djangoGraphene-Django bridges Django models and…
permissive · top 5,000 on PyPI
ariadne-codegenGenerates fully typed, asynchronous Python…
permissive · top 5,000 on PyPI
gqlA GraphQL client for Python that executes…
permissive · top 1,000 on PyPI
ariadneAriadne is a Python library for building…
permissive · top 5,000 on PyPI
graphene-django-optimizerAutomatically optimizes GraphQL queries…
permissive · top 15,000 on PyPI
graphql-relayProvides Relay-compliant patterns for…
permissive · top 1,000 on PyPI
django-graphql-jwtAdds JSON Web Token (JWT) authentication to…
permissive · top 15,000 on PyPI
django-graphiql-debug-toolbarIntegrates Django Debug Toolbar into the…
permissive · top 15,000 on PyPI
algoliasearch-djangoIntegrates Algolia's hosted search service into…
permissive · top 5,000 on PyPI