Skip to content

Commit 05b9027

Browse files
committed
Release 🍓 0.308.0
1 parent 2ae9071 commit 05b9027

File tree

3 files changed

+43
-38
lines changed

3 files changed

+43
-38
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,48 @@
11
CHANGELOG
22
=========
33

4+
0.308.0 - 2026-03-03
5+
--------------------
6+
7+
This release adds support for defining fields using the `Annotated` syntax. This provides an
8+
alternative way to specify field metadata alongside the type annotation.
9+
10+
Example usage:
11+
12+
```python
13+
from typing import Annotated
14+
15+
import strawberry
16+
17+
18+
@strawberry.type
19+
class Query:
20+
name: Annotated[str, strawberry.field(description="The name")]
21+
age: Annotated[int, strawberry.field(deprecation_reason="Use birthDate instead")]
22+
23+
24+
@strawberry.input
25+
class CreateUserInput:
26+
name: Annotated[str, strawberry.field(description="User's name")]
27+
email: Annotated[str, strawberry.field(description="User's email")]
28+
```
29+
30+
This syntax works alongside the existing assignment syntax:
31+
32+
```python
33+
@strawberry.type
34+
class Query:
35+
# Both styles work
36+
field1: Annotated[str, strawberry.field(description="Using Annotated")]
37+
field2: str = strawberry.field(description="Using assignment")
38+
```
39+
40+
All `strawberry.field()` options are supported including `description`, `name`,
41+
`deprecation_reason`, `directives`, `metadata`, and `permission_classes`.
42+
43+
Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #4059](https://github.com/strawberry-graphql/strawberry/pull/4059/)
44+
45+
446
0.307.1 - 2026-02-24
547
--------------------
648

RELEASE.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "strawberry-graphql"
3-
version = "0.307.1"
3+
version = "0.308.0"
44
description = "A library for creating GraphQL APIs"
55
authors = [{ name = "Patrick Arminio", email = "patrick.arminio@gmail.com" }]
66
license = { text = "MIT" }

0 commit comments

Comments
 (0)