--- id: strawberry-graphql version: "0.324.0" license: MIT license_treatment: permissive maintenance: active --- # strawberry-graphql — A library for creating GraphQL APIs License: permissive · Maintenance: active · Downloads: 7.7M/mo ## What it is and what it does Strawberry GraphQL lets you define GraphQL schemas using Python dataclasses and type annotations, eliminating the need to write separate schema definition files. You decorate Python classes with @strawberry.type and methods with @strawberry.field, then pass them to strawberry.Schema() to generate a complete GraphQL API. The library handles type validation and schema generation automatically. It integrates with popular Python web frameworks—Django, Starlette, and others—through dedicated view classes and middleware. A built-in dev server and CLI tool let you test schemas immediately. The package depends on graphql-core for GraphQL execution, python-dateutil for date handling, typing-extensions for compatibility, packaging for version parsing, and cross-web for framework integration. Type checking is supported via a mypy plugin. Use it for: - Build a GraphQL API endpoint in a Django application by adding the strawberry.django app and GraphQLView to your URL routing. - Create a type-safe GraphQL schema using Python dataclasses, with automatic validation and introspection support. - Prototype and test a GraphQL schema locally using the strawberry dev server before deploying to production. - Integrate GraphQL into an async web framework like Starlette or Quart for high-concurrency API serving. - Enable static type checking of your GraphQL schema definition using the mypy plugin for early error detection. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Strawberry GraphQL is a Python library for building GraphQL APIs using Python dataclasses and type annotations, with built-in support for schema definition, dev servers, and framework integrations. Yes. Strawberry GraphQL is actively maintained, has low install friction, carries a permissive MIT license, and is in the top 5000 PyPI packages by download volume. It is a solid choice for building GraphQL APIs in Python, especially if you prefer dataclass-based schema definition and framework integration over manual schema files. No known security vulnerabilities. ## Install pip install strawberry-graphql uv add strawberry-graphql poetry add strawberry-graphql ## Installing strawberry-graphql Before you install: Low install friction with a pure-Python wheel distribution. Active maintenance with a release 4 days ago. Requires Python 3.10 or later. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice. Quickstart: pip install strawberry-graphql import strawberry @strawberry.type class Query: @strawberry.field def hello(self) -> str: return "world" schema = strawberry.Schema(query=Query) Requires Python 3.10 or later; the CLI extra requires additional dependencies beyond the base install. Verify before relying: - Whether the mypy plugin integration works reliably with current mypy versions - Performance characteristics under high query load compared to other GraphQL libraries - Maturity and stability of the Django integration layer ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 7.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags graphql api python, graphql server dataclasses, python graphql library, graphql schema builder, async graphql framework, graphql django integration, type-safe graphql python, graphql, async-ready, type-safe [View on SkillFed](https://skillfed.io/packages/strawberry-graphql) · [View on PyPI](https://pypi.org/project/strawberry-graphql/)