Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dynamic_type():
_type = registry.get_type_for_model(model)
if not _type:
return None
if (direction == interfaces.MANYTOONE or not relationship.uselist):
return Field(_type)
elif (direction == interfaces.ONETOMANY or
direction == interfaces.MANYTOMANY):
if is_node(_type):
return SQLAlchemyConnectionField(_type)
return Field(List(_type))