Strawberry GraphQL is a Python library for defining and serving GraphQL APIs with type hints. It offers async resolvers, integrations with web frameworks, and optional dev server tooling.
Overview
Strawberry GraphQL lets Python developers define GraphQL types and queries using dataclasses and type annotations. You model types with decorators such as @strawberry.type and expose fields through resolver methods, then serve the schema from your application or a bundled dev server.
The library supports async and await for non-blocking resolvers, schema and field extensions, generics for reusable types, federation for composed schemas, and dataloaders to batch related loads. A mypy plugin can statically type-check GraphQL schema definitions when enabled in mypy configuration.
Integrations connect Strawberry to common Python web stacks, including Django through a provided view you add to urls.py and INSTALLED_APPS. The quick-start path installs a CLI and dev server so you can prototype a schema and open GraphiQL in a browser.
Documentation and examples cover deployment patterns alongside framework-specific setup; the project is maintained as an open GraphQL option for modern Python API work.
Key features
- Type-hint-based schema definitions
- Async resolver support
- Schema and field extensions
- GraphQL federation support
- Dataloader batching
- mypy plugin for schema typing
- Django view integration
- Dev server with GraphiQL
Use cases
- Build GraphQL APIs in Python
- Add a GraphQL endpoint to Django
- Prototype schemas with the dev server
- Federate services into one graph
- Type-check GraphQL types with mypy