When resolving a federation entity, the router may serialize Python objects for transmission purposes, but the entity on the receiving side may not deserialize or validate them.
For example, a datetime
object may be automatically converted to an ISO-formatted string by the router, but the receiving side may not convert it back to a datetime
object.
Original behavior:
@strawberry.federation.type(keys=["id"])
class Order:
id: str
create_at: datetime
>>> Order(id="some-order-id", create_at='2023-01-20T08:14:18.969624')
Order(id='some-order-id', create_at='2023-01-20T08:14:18.969624')
Excepted behavior:
@strawberry.federation.type(keys=["id"])
class Order:
id: str
create_at: datetime
>>> Order(id="some-order-id", create_at='2023-01-20T08:14:18.969624')
Order(id='some-order-id', create_at=datetime.datetime(2023, 1, 20, 8, 14, 18, 969624))
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too