skillfed

strawberry-graphql

A library for creating GraphQL APIs

strawberry-graphql v0.324.0 7.7M downloads/30d#1,701 on PyPI
Permissive license MIT Active released

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 on this page — 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

strawberry-graphql on PyPI

pip

pip install strawberry-graphql

uv

uv add strawberry-graphql

poetry

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 the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — graphql-core, typing-extensions, python-dateutil, packaging, cross-web
Maintenance actively maintained — 4 days since the last release
First released
Downloads 7,728,614/month — #1,701 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: strawberry_graphql-0.324.0-py3-none-any.whl

Keywords: graphql, api, rest, starlette, async

Development Status :: 5 - Production/StableIntended Audience :: DevelopersTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

graphql api pythongraphql server dataclassespython graphql librarygraphql schema builderasync graphql frameworkgraphql django integrationtype-safe graphql python
graphqlasync-readytype-safe

More Libraries packages