Skip to content

Commit 5510bf1

Browse files
committed
Release 🍓 0.277.1
1 parent 5562692 commit 5510bf1

File tree

3 files changed

+52
-47
lines changed

3 files changed

+52
-47
lines changed

CHANGELOG.md

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

4+
0.277.1 - 2025-07-19
5+
--------------------
6+
7+
This release fixes the resolution of `Generics` when specializing using a union
8+
defined with `Annotated`, like in the example below:
9+
10+
```python
11+
from typing import Annotated, Generic, TypeVar, Union
12+
import strawberry
13+
14+
T = TypeVar("T")
15+
16+
17+
@strawberry.type
18+
class User:
19+
name: str
20+
age: int
21+
22+
23+
@strawberry.type
24+
class ProUser:
25+
name: str
26+
age: float
27+
28+
29+
@strawberry.type
30+
class GenType(Generic[T]):
31+
data: T
32+
33+
34+
GeneralUser = Annotated[Union[User, ProUser], strawberry.union("GeneralUser")]
35+
36+
37+
@strawberry.type
38+
class Response(GenType[GeneralUser]): ...
39+
40+
41+
@strawberry.type
42+
class Query:
43+
@strawberry.field
44+
def user(self) -> Response: ...
45+
46+
47+
schema = strawberry.Schema(query=Query)
48+
```
49+
50+
Before this would raise a `TypeError`, now it works as expected.
51+
52+
Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #3950](https://github.com/strawberry-graphql/strawberry/pull/3950/)
53+
54+
455
0.277.0 - 2025-07-18
556
--------------------
657

RELEASE.md

Lines changed: 0 additions & 46 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.277.0"
3+
version = "0.277.1"
44
description = "A library for creating GraphQL APIs"
55
authors = [{ name = "Patrick Arminio", email = "[email protected]" }]
66
license = { text = "MIT" }

0 commit comments

Comments
 (0)