WP_Query posts with comments only

If you’d like to change the SQL query for a WP_Query, you’re going to need to use the posts_join filter, or in your case, it’s easier to go for a simple posts_where:

function my_has_comments_filter( $where ) {
    $where .= ' AND comment_count > 0 ';
    return $where;
}

add_filter( 'posts_where', 'my_has_comments_filter' );
$query = new WP_Query( array(
    'posts_per_page' => 10,
) );

// Don't filter future queries.
remove_filter( 'posts_where', 'my_has_comments_filter' );

Hope that helps!