def METHOD_NAME(
    filter_by,
    warehouses_order,
    staff_api_client,
    permission_manage_products,
    warehouses_for_pagination,
):
    # given
    page_size = 2
    variables = {"first": page_size, "after": None, "filter": filter_by}
    # when
    response = staff_api_client.post_graphql(
        QUERY_WAREHOUSES_PAGINATION, variables, permissions=[permission_manage_products]
    )
    # then
    content = get_graphql_content(response)
    warehouses_nodes = content["data"]["warehouses"]["edges"]
    assert warehouses_order[0] == warehouses_nodes[0]["node"]["name"]
    assert warehouses_order[1] == warehouses_nodes[1]["node"]["name"]
    assert len(warehouses_nodes) == page_size