SYSTEM Cited by 1 source
Strawberry GraphQL¶
Definition¶
Strawberry (strawberry.rocks) is a Python GraphQL library that uses native Python type hints to declare GraphQL schemas and resolvers. It supports Apollo Federation v2 for building federated subgraphs.
import strawberry
@strawberry.type
class Book:
title: str
author: str
@strawberry.type
class Query:
@strawberry.field
def books(self) -> list[Book]:
return [...]
The schema is derived from the type annotations — no separate SDL file to keep in sync.
Why Yelp picked it for the CHAOS subgraph¶
Verbatim from the 2025-07-08 post: "utilizing Strawberry for federated Python subgraphs to leverage type-safe schema definitions and Python's type hints." Two specific benefits the post calls out:
- Type safety in Python. Strawberry resolvers are regular typed Python functions, so mypy / Pyright catch schema-to- implementation drift at CI time.
- Federation support. Strawberry implements Federation v2
directives (
@key,@shareable,@extends, …) natively, so the CHAOS subgraph can plug directly into Yelp's supergraph.
Ecosystem position¶
- Contemporaries in Python: Graphene (older, class-based API), Ariadne (schema-first), gql (client library).
- Strawberry is the current default for new Python GraphQL servers inside organisations that care about type hints.
- Rust/TypeScript equivalents: async-graphql (Rust), Apollo Server (TypeScript) — same federated-subgraph story, not Python.
Seen in¶
- sources/2025-07-08-yelp-exploring-chaos-building-a-backend-for-server-driven-ui — Yelp's CHAOS subgraph is a Strawberry-based Python service; first wiki instance.