We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents aa89eba + 468bf0c commit 329b209Copy full SHA for 329b209
src/strawberry_sqlalchemy_mapper/mapper.py
@@ -639,10 +639,19 @@ def convert(type_: Any) -> Any:
639
or "return" not in descriptor.__annotations__
640
):
641
raise HybridPropertyNotAnnotated(key)
642
+ annotation = descriptor.__annotations__["return"]
643
+ if isinstance(annotation, str):
644
+ try:
645
+ if "typing" in annotation:
646
+ # Try to evaluate from existing typing imports
647
+ annotation = annotation[7:]
648
+ annotation = eval(annotation)
649
+ except NameError:
650
+ raise UnsupportedDescriptorType(key)
651
self._add_annotation(
652
type_,
653
key,
- descriptor.__annotations__["return"],
654
+ annotation,
655
generated_field_keys,
656
)
657
else:
0 commit comments