def METHOD_NAME(
    root: ChannelContext[models.Collection], info: ResolveInfo, **kwargs
):
    check_for_sorting_by_rank(info, kwargs)
    search = kwargs.get("search")
    requestor = get_user_or_app_from_context(info.context)
    qs = root.node.products.visible_to_user(  # type: ignore[attr-defined] # mypy does not properly resolve the related manager # noqa: E501
        requestor, root.channel_slug
    )
    if search:
        qs = ChannelQsContext(
            qs=search_products(qs.qs, search), channel_slug=root.channel_slug
        )
    else:
        qs = ChannelQsContext(qs=qs, channel_slug=root.channel_slug)
    kwargs["channel"] = root.channel_slug
    qs = filter_connection_queryset(qs, kwargs)
    return create_connection_slice(qs, info, kwargs, ProductCountableConnection)