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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,32 @@
1
1
CHANGELOG
2
2
=========
3
3
4
+
0.257.0 - 2025-01-09
5
+
--------------------
6
+
7
+
The common `node: Node` used to resolve relay nodes means we will be relying on
8
+
is_type_of to check if the returned object is in fact a subclass of the Node
9
+
interface.
10
+
11
+
However, integrations such as Django, SQLAlchemy and Pydantic will not return
12
+
the type itself, but instead an alike object that is later resolved to the
13
+
expected type.
14
+
15
+
In case there are more than one possible type defined for that model that is
16
+
being returned, the first one that replies True to `is_type_of` check would be
17
+
used in the resolution, meaning that when asking for `"PublicUser:123"`,
18
+
strawberry could end up returning `"User:123"`, which can lead to security
19
+
issues (such as data leakage).
20
+
21
+
In here we are introducing a new `strawberry.cast`, which will be used to mark
22
+
an object with the already known type by us, and when asking for is_type_of that
23
+
mark will be used to check instead, ensuring we will return the correct type.
24
+
25
+
That `cast` is already in place for the relay node resolution and pydantic.
26
+
27
+
Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #3749](https://github.com/strawberry-graphql/strawberry/pull/3749/)
0 commit comments