strawberry-graphql / strawberry-sqlalchemy

A SQLAlchemy Integration for strawberry-graphql
MIT License
91 stars 26 forks source link

Improved hybrid_property Type Handling #10

Closed gravy-jones-locker closed 1 year ago

gravy-jones-locker commented 1 year ago

For unknown reasons, when using sqlalchemy.inspect composite return types on hybrid_property decorated methods are defined as strings in __annotations__["return"]

This PR updates the relevant block to evaluate the given strings (e.g. "typing.Union[float, None]", "typing.Optional[float]") and raise an appropriate error if the type cannot be handled.