strawberry-graphql
Code-first GraphQL library for Python with type hints, async resolvers, data loaders, and schema federation.
Official Documentation ↗v0.236. Check the official docs for the latest API surface.Installation
pip install strawberry-graphqlMethods
No methods match this filter.
strawberry-graphql is code-first graphql library for python with type hints, async resolvers, data loaders, and schema federation. This page documents the core methods, installation, and common usage patterns for the current stable release.
Installation
Install strawberry-graphql with your preferred package manager using the command shown in the frontmatter. The package is published to the Python Package Index and ships with TypeScript types where applicable.
Core methods
The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v0.236 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.
Frequently asked questions
The faq section in the frontmatter answers the most common questions about strawberry-graphql, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.
API reference evidence
Fetched from official sources on 2026-11-08T16:03:08.4363995+08:00 via WebFetch 官方文档站(/docs、/docs/api 均无 API reference);签名取自官方仓库 strawberry 源码 docstring.
strawberry.type→ signature from https://raw.githubusercontent.com/strawberry-graphql/strawberry/main/strawberry/types/object_type.py; official text: “def type(cls: T, *, name: str | None = None, is_input: bool = False, is_interface: bool = False, description: str | None = None, directives: Sequence[object] | None = (), extend: bool = False) -> T”strawberry.mutation→ signature from https://raw.githubusercontent.com/strawberry-graphql/strawberry/main/strawberry/types/mutation.py; official text: “def mutation(resolver: _RESOLVER_TYPE[Any] | None = None, *, name: str | None = None, description: str | None = None, permission_classes: list[type[BasePermission]] | None = None, deprecation_reason: str | None = None, d”strawberry.Schema→ signature from https://raw.githubusercontent.com/strawberry-graphql/strawberry/main/strawberry/schema/schema.py; official text: “class Schema(BaseSchema): def init(self, query: type, mutation: type | None = None, subscription: type | None = None, directives: Iterable[StrawberryDirective] = (), types: Iterable[type | StrawberryType] = (), exten”
FAQ
- Is it async-compatible?
- Yes. Use async def resolvers; Strawberry integrates with asyncio and ASGI frameworks.
- Does it support federation?
- Yes. Use strawberry.federation to define entities and extend types across services.
- Can I use it with FastAPI?
- Yes. Use strawberry.fastapi.GraphQLRouter to mount the schema on a FastAPI app.
Report a problem with this API docOpens a pre-filled issue on GitHub.