Skip to content

Commit

Permalink
Add release file
Browse files Browse the repository at this point in the history
  • Loading branch information
tjeerddie committed Aug 10, 2023
1 parent bf5b6df commit e910059
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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
```

0 comments on commit e910059

Please sign in to comment.