def METHOD_NAME(
    info: ResolveInfo, requestor, channel_slug=None
) -> ChannelQsContext:
    database_connection_name = get_database_connection_name(info.context)
    qs = (
        models.Product.objects.all()
        .using(database_connection_name)
        .visible_to_user(requestor, channel_slug)
    )
    if not has_one_of_permissions(requestor, ALL_PRODUCTS_PERMISSIONS):
        channels = Channel.objects.filter(slug=str(channel_slug))
        product_channel_listings = models.ProductChannelListing.objects.filter(
            Exists(channels.filter(pk=OuterRef("channel_id"))),
            visible_in_listings=True,
        )
        qs = qs.filter(
            Exists(product_channel_listings.filter(product_id=OuterRef("pk")))
        )
    return ChannelQsContext(qs=qs, channel_slug=channel_slug)