{"id":25431950,"url":"https://github.com/strawberry-graphql/strawberry-django","last_synced_at":"2026-05-03T12:03:17.592Z","repository":{"id":37029415,"uuid":"308695886","full_name":"strawberry-graphql/strawberry-django","owner":"strawberry-graphql","description":"Strawberry GraphQL Django extension","archived":false,"fork":false,"pushed_at":"2026-03-30T16:43:15.000Z","size":2695,"stargazers_count":490,"open_issues_count":93,"forks_count":149,"subscribers_count":14,"default_branch":"main","last_synced_at":"2026-04-03T03:21:15.278Z","etag":null,"topics":["django","graphql","strawberry-graphql"],"latest_commit_sha":null,"homepage":"https://strawberry.rocks/docs/django","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strawberry-graphql.png","metadata":{"funding":{"polar":"strawberry-graphql","open_collective":"strawberry-graphql","github":"strawberry-graphql"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2020-10-30T17:12:01.000Z","updated_at":"2026-04-02T02:01:42.000Z","dependencies_parsed_at":"2023-02-18T16:45:33.928Z","dependency_job_id":"4b15d23b-17fc-476c-82bb-25c8a2ad35b7","html_url":"https://github.com/strawberry-graphql/strawberry-django","commit_stats":{"total_commits":596,"total_committers":82,"mean_commits":"7.2682926829268295","dds":0.761744966442953,"last_synced_commit":"2d12b278b5113554eb22c214e119a82a5c7ad812"},"previous_names":["strawberry-graphql/strawberry-django","strawberry-graphql/strawberry-graphql-django"],"tags_count":176,"template":false,"template_full_name":null,"purl":"pkg:github/strawberry-graphql/strawberry-django","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strawberry-graphql%2Fstrawberry-django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strawberry-graphql%2Fstrawberry-django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strawberry-graphql%2Fstrawberry-django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strawberry-graphql%2Fstrawberry-django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strawberry-graphql","download_url":"https://codeload.github.com/strawberry-graphql/strawberry-django/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strawberry-graphql%2Fstrawberry-django/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31461534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","graphql","strawberry-graphql"],"created_at":"2025-02-17T04:30:53.299Z","updated_at":"2026-04-06T06:03:13.351Z","avatar_url":"https://github.com/strawberry-graphql.png","language":"Python","funding_links":["https://polar.sh/strawberry-graphql","https://opencollective.com/strawberry-graphql","https://github.com/sponsors/strawberry-graphql"],"categories":["GraphQL","Third-Party Packages"],"sub_categories":["APIs"],"readme":"# Strawberry GraphQL Django Integration\n\n[![CI](https://github.com/strawberry-graphql/strawberry-django/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/strawberry-graphql/strawberry-django/actions/workflows/tests.yml?query=branch%3Amain)\n[![Coverage](https://codecov.io/gh/strawberry-graphql/strawberry-django/branch/main/graph/badge.svg)](https://codecov.io/gh/strawberry-graphql/strawberry-django/tree/main)\n[![PyPI](https://img.shields.io/pypi/v/strawberry-graphql-django)](https://pypi.org/project/strawberry-graphql-django/)\n[![Downloads](https://pepy.tech/badge/strawberry-graphql-django)](https://pepy.tech/project/strawberry-graphql-django)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/strawberry-graphql-django)\n\n[**Documentation**](https://strawberry.rocks/docs/django) | [**Discord**](https://strawberry.rocks/discord)\n\nStrawberry GraphQL Django integration provides powerful tools to build GraphQL APIs with Django. Automatically generate GraphQL types, queries, mutations, and resolvers from your Django models with full type safety.\n\n## Installation\n\n```shell\npip install strawberry-graphql-django\n```\n\n## Features\n\n- 🍓 **Automatic Type Generation** - Generate GraphQL types from Django models with full type safety\n- 🔍 **Advanced Filtering** - Powerful filtering system with lookups (contains, exact, in, etc.)\n- 📄 **Pagination** - Built-in offset and cursor-based (Relay) pagination\n- 📊 **Ordering** - Sort results by any field with automatic ordering support\n- 🔐 **Authentication \u0026 Permissions** - Django auth integration with flexible permission system\n- ✨ **CRUD Mutations** - Auto-generated create, update, and delete mutations with validation\n- ⚡ **Query Optimizer** - Automatic `select_related` and `prefetch_related` to prevent N+1 queries\n- 🐍 **Django Integration** - Works with Django views (sync and async), forms, and validation\n- 🐛 **Debug Toolbar** - GraphiQL integration with Django Debug Toolbar for query inspection\n\n## Quick Start\n\n```python\n# models.py\nfrom django.db import models\n\n\nclass Fruit(models.Model):\n    name = models.CharField(max_length=20)\n    color = models.ForeignKey(\"Color\", on_delete=models.CASCADE, related_name=\"fruits\")\n\n\nclass Color(models.Model):\n    name = models.CharField(max_length=20)\n```\n\n```python\n# types.py\nimport strawberry_django\nfrom strawberry import auto\nfrom . import models\n\n\n@strawberry_django.type(models.Fruit)\nclass Fruit:\n    id: auto\n    name: auto\n    color: \"Color\"\n\n\n@strawberry_django.type(models.Color)\nclass Color:\n    id: auto\n    name: auto\n    fruits: list[Fruit]\n```\n\n```python\n# schema.py\nimport strawberry\nimport strawberry_django\nfrom strawberry_django.optimizer import DjangoOptimizerExtension\nfrom .types import Fruit\n\n\n@strawberry.type\nclass Query:\n    fruits: list[Fruit] = strawberry_django.field()\n\n\nschema = strawberry.Schema(\n    query=Query,\n    extensions=[DjangoOptimizerExtension],\n)\n```\n\n```python\n# urls.py\nfrom django.urls import path\nfrom strawberry.django.views import AsyncGraphQLView\nfrom .schema import schema\n\nurlpatterns = [\n    path(\"graphql/\", AsyncGraphQLView.as_view(schema=schema)),\n]\n```\n\nThat's it! You now have a fully functional GraphQL API with:\n- Automatic type inference from Django models\n- Optimized database queries (no N+1 problems)\n- Interactive GraphiQL interface at `/graphql/`\n\nVisit http://localhost:8000/graphql/ and try this query:\n\n```graphql\nquery {\n  fruits {\n    id\n    name\n    color {\n      name\n    }\n  }\n}\n```\n\n## Next Steps\n\nCheck out our comprehensive documentation:\n\n- 📚 [**Getting Started Guide**](https://strawberry.rocks/docs/django) - Complete tutorial with examples\n- 🎓 [**Example App**](./examples/ecommerce_app/) - Full-featured e-commerce application\n- 📖 [**Documentation**](https://strawberry.rocks/docs/django) - In-depth guides and API reference\n- 💬 [**Discord Community**](https://strawberry.rocks/discord) - Get help and share your projects\n\n## Contributing\n\nWe welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated 😊\n\n**Quick Start:**\n\n```shell\ngit clone https://github.com/strawberry-graphql/strawberry-django\ncd strawberry-django\npre-commit install\n```\n\nThen run tests with `make test` or `make test-dist` for parallel execution.\n\n## Community\n\n- 💬 [**Discord**](https://strawberry.rocks/discord) - Join our community for help and discussions\n- 🐛 [**GitHub Issues**](https://github.com/strawberry-graphql/strawberry-django/issues) - Report bugs or request features\n- 💡 [**GitHub Discussions**](https://github.com/strawberry-graphql/strawberry-django/discussions) - Ask questions and share ideas\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrawberry-graphql%2Fstrawberry-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrawberry-graphql%2Fstrawberry-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrawberry-graphql%2Fstrawberry-django/lists"}