You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{project_name} {version} is out! This release adds exception handlers, a building block for integrations that want to turn expected Python errors into typed GraphQL results. 🍓 https://strawberry.rocks/release/{version}
6
+
linkedin: >-
7
+
{project_name} {version} is out. This release adds exception handlers, a schema-level hook for integrations that need to turn framework validation errors, such as Pydantic errors, into typed GraphQL union results. Most applications will not need to use this directly, but it gives framework integrations a cleaner path without adding try/except blocks to every resolver.
8
+
---
9
+
10
+
This release adds configurable exception handlers that map Python exceptions to
11
+
typed GraphQL union results.
12
+
13
+
Most applications do not need to adopt this directly. It is primarily useful for
14
+
integrations and framework-level helpers: for example, catching validation
15
+
exceptions from a library such as Pydantic and exposing them as an explicit
16
+
GraphQL error type, without requiring every resolver to catch and convert those
17
+
exceptions manually.
18
+
19
+
Handlers are passed to `strawberry.Schema` (and `strawberry.federation.Schema`):
20
+
21
+
```python
22
+
import strawberry
23
+
from strawberry.types.field import StrawberryField
0 commit comments