--- id: strawberry-graphql-django version: "0.87.0" license: MIT license_treatment: permissive maintenance: active --- # strawberry-graphql-django — Strawberry GraphQL Django extension License: permissive · Maintenance: active · Downloads: 1.4M/mo ## 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 above — 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 pip install strawberry-graphql-django uv add strawberry-graphql-django poetry add strawberry-graphql-django ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django graphql integration, automatic graphql types from models, django orm to graphql, graphql api builder django, graphql mutations django models, django query optimization graphql, graphql schema from django models, graphql-api, django-integration, orm-bridge [View on SkillFed](https://skillfed.io/packages/strawberry-graphql-django) · [View on PyPI](https://pypi.org/project/strawberry-graphql-django/)