Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def convert_onetoone_field_to_djangomodel(field, registry=None):
model = get_related_model(field)
def dynamic_type():
_type = registry.get_type_for_model(model)
if not _type:
return
return Field(_type)
return Dynamic(dynamic_type)
def convert_field_to_djangomodel(field, registry=None):
model = get_related_model(field)
def dynamic_type():
_type = registry.get_type_for_model(model)
if not _type:
return
return Field(_type, description=field.help_text)
return Dynamic(dynamic_type)
def convert_field_to_list_or_connection(field, registry=None):
model = get_related_model(field)
def dynamic_type():
_type = registry.get_type_for_model(model)
if not _type:
return
if is_node(_type):
return get_connection_field(_type)
return Field(List(_type))
return Dynamic(dynamic_type)