I think you should use `WP_CLI\Iterators\Query` here.