def get_type_from_id_field_name(id_field_name: str) -> str:
    """
    Given a field name like "child_ids" or "parent_id" return the plural form of the
    first part, i.e. "children" or "parents" for these examples.
    """
    no_suffix = id_field_name.removesuffix("_ids").removesuffix("_id")
    if no_suffix == "child":
        return "children"
    return f"{no_suffix}s"