async def METHOD_NAME(
    view: foc.SampleCollection, input: CountValues
) -> t.Tuple[t.Callable[[t.List], CountValuesResponses], foa.CountValues]:
    field = view.get_field(input.field)
    while isinstance(field, fo.ListField):
        field = field.field
    def resolve(data: t.List):
        _, data = data
        values = [ValueCount(key=value, value=count) for value, count in data]
        if isinstance(field, fo.StringField):
            return StrCountValuesResponse(values=values)
        if isinstance(field, fo.BooleanField):
            return BoolCountValuesResponse(values=values)
        if isinstance(field, fo.IntField):
            return IntCountValuesResponse(values=values)
    return resolve, foa.CountValues(input.field, _first=LIST_LIMIT, _asc=False)