File tree Expand file tree Collapse file tree 3 files changed +36
-31
lines changed
Expand file tree Collapse file tree 3 files changed +36
-31
lines changed Original file line number Diff line number Diff line change 11CHANGELOG
22=========
33
4+ 0.311.0 - 2026-03-08
5+ --------------------
6+
7+ Enums can now be registered via ` Annotated ` . The preferred way is still using
8+ ` @strawberry.enum ` as a decorator, but when you need to expose an existing enum
9+ under a different name or alias, ` Annotated ` works as a proper type alias in all
10+ type checkers:
11+
12+ ``` python
13+ from typing import Annotated
14+ from enum import Enum
15+ import strawberry
16+
17+
18+ class IceCreamFlavour (Enum ):
19+ VANILLA = " vanilla"
20+ STRAWBERRY = " strawberry"
21+ CHOCOLATE = " chocolate"
22+
23+
24+ MyIceCreamFlavour = Annotated[
25+ IceCreamFlavour, strawberry.enum(description = " Ice cream flavours" )
26+ ]
27+
28+
29+ @strawberry.type
30+ class Query :
31+ @strawberry.field
32+ def flavour (self ) -> MyIceCreamFlavour:
33+ return IceCreamFlavour.VANILLA
34+ ```
35+
36+ Contributed by [ Thiago Bellini Ribeiro] ( https://github.com/bellini666 ) via [ PR #4293 ] ( https://github.com/strawberry-graphql/strawberry/pull/4293/ )
37+
38+
4390.310.2 - 2026-03-08
540--------------------
641
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11[project ]
22name = " strawberry-graphql"
3- version = " 0.310.2 "
3+ version = " 0.311.0 "
44description = " A library for creating GraphQL APIs"
55authors = [{ name = " Patrick Arminio" , email = " patrick.arminio@gmail.com" }]
66license = { text = " MIT" }
You can’t perform that action at this time.
0 commit comments