diff --git a/CHANGELOG.md b/CHANGELOG.md index 83bb1e15df..5de2905789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,39 @@ CHANGELOG ========= +0.203.2 - 2023-08-14 +-------------------- + +Enhancements: +- Improved pydantic conversion compatibility with specialized list classes. + - Modified `StrawberryAnnotation._is_list` to check if the `annotation` extends from the `list` type, enabling it to be considered a list. + - in `StrawberryAnnotation` Moved the `_is_list` check before the `_is_generic` check in `resolve` to avoid `unsupported` error in `_is_generic` before it checked `_is_list`. + +This enhancement enables the usage of constrained lists as class types and allows the creation of specialized lists. The following example demonstrates this feature: + +```python +import strawberry +from pydantic import BaseModel, ConstrainedList + + +class FriendList(ConstrainedList): + min_items = 1 + + +class UserModel(BaseModel): + age: int + friend_names: FriendList[str] + + +@strawberry.experimental.pydantic.type(UserModel) +class User: + age: strawberry.auto + friend_names: strawberry.auto +``` + +Contributed by [tjeerddie](https://github.com/tjeerddie) via [PR #2909](https://github.com/strawberry-graphql/strawberry/pull/2909/) + + 0.203.1 - 2023-08-12 -------------------- diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 853d3b19b6..0000000000 --- a/RELEASE.md +++ /dev/null @@ -1,28 +0,0 @@ -Release type: patch - -Enhancements: -- Improved pydantic conversion compatibility with specialized list classes. - - Modified `StrawberryAnnotation._is_list` to check if the `annotation` extends from the `list` type, enabling it to be considered a list. - - in `StrawberryAnnotation` Moved the `_is_list` check before the `_is_generic` check in `resolve` to avoid `unsupported` error in `_is_generic` before it checked `_is_list`. - -This enhancement enables the usage of constrained lists as class types and allows the creation of specialized lists. The following example demonstrates this feature: - -```python -import strawberry -from pydantic import BaseModel, ConstrainedList - - -class FriendList(ConstrainedList): - min_items = 1 - - -class UserModel(BaseModel): - age: int - friend_names: FriendList[str] - - -@strawberry.experimental.pydantic.type(UserModel) -class User: - age: strawberry.auto - friend_names: strawberry.auto -``` diff --git a/pyproject.toml b/pyproject.toml index a67221e307..a65af9e65d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "strawberry-graphql" packages = [ { include = "strawberry" } ] -version = "0.203.1" +version = "0.203.2" description = "A library for creating GraphQL APIs" authors = ["Patrick Arminio "] license = "MIT"