Add a GraphQL API to an existing Django or FastAPI project without rewriting your data layer.
Define your API schema using Python type annotations and let Strawberry auto-generate the GraphQL schema.
Use the built-in GraphiQL browser tool to explore and test your API during development without a separate client.
Run mypy with the Strawberry plugin to catch GraphQL schema errors at development time before deploying.
Install via pip, built-in dev server means no extra infrastructure needed to try your first query.
Strawberry is a Python library for building GraphQL APIs. GraphQL is an approach to building web APIs where the client specifies exactly which fields it wants, and the server returns only that data, rather than a fixed response shape regardless of what the caller needs. This pattern is common in apps that have many different types of clients, each needing a different subset of the same underlying data. With Strawberry, you define your data using Python's built-in type annotation syntax, the same style you use in regular Python code to describe variable types. The library reads those annotations and generates the corresponding GraphQL schema automatically, so there is no separate schema definition language to learn or maintain. You write Python classes, add a few decorators, and Strawberry handles translating that into the structure GraphQL clients expect. Getting started is quick. Install the package with pip, write a file that defines your data types and query fields, and run the included development server. Strawberry ships with a browser-based tool called GraphiQL, which lets you type queries and inspect results without writing a separate client application. The library integrates with several popular Python web frameworks including Django, FastAPI, and Starlette, so it can be added to an existing project without a full rewrite. It also includes a plugin for mypy, a Python type-checking tool, allowing you to catch schema errors during development rather than at runtime. The project is open source under the MIT license. A Discord community, a contributing guide, and several example repositories are available for those who want to go further.
← strawberry-graphql on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.