async def METHOD_NAME(
    conn: triopg._triopg.TrioConnectionProxy, organization_id: OrganizationID
) -> List[RealmGrantedRole]:
    granted_roles = []
    rows = await conn.fetch(
        *_q_get_organization_realms_granted_roles(organization_id=organization_id.str)
    )
    for row in rows:
        granted_roles.append(
            RealmGrantedRole(
                certificate=row["certificate"],
                realm_id=RealmID.from_hex(row["realm_id"]),
                user_id=UserID(row["user_id"]),
                role=RealmRole.from_str(row["role"]),
                granted_by=DeviceID(row["granted_by"]),
                granted_on=row["granted_on"],
            )
        )
    return granted_roles