How to debug EntityQuery?
If you use devel module a simple approach for debugging entity query could be use the debug tag (simply add $query-&gt;addTag('debug') to your query).
Here an example

$query = $this-&gt;entity_query-&gt;get('node');
$query-&gt;condition('status', NODE_PUBLISHED);
$query-&gt;addTag('debug');
$query-&gt;execute();


And the result