Closed conao3 closed 2 years ago
In modern python, instead of a class, it contains class name
This commit message is wrong. The truth is,
Under `from __future__ import annotations`, instead of a class, it contains class name
I just looked at your PR, I think it's a useful change!
Is there any reason you're selecting the corresponding Graphene Types using a switch/case statement instead of adapting the annotation-based system that is used to register SQLAlchemy types? (@convert_sqlalchemy_type.register(JSONType)
)
I think creating an annotation for the hybrid properties (e.g. something like @convert_sqlalchemy_type.register_hybrid(Type)
) would allow for more flexibility, and is IMO the preferred option over statically converting the base types, since it would allow users to add their own support for types like Tuples etc until we include them. What do you think?
Thanks again for initiating this @conao3!
Thank you, too!
Fix below TODO comment.
Examines the return type of the function of
hybrid_property
and converts it to the default graphene type.