Retriving nodes by content type using Drupal::entityQuery
This is how we do this:

$ids = \Drupal::entityQuery('node')
  -&gt;condition('type', 'product')
  -&gt;execute();

$products = \Drupal::entityManager()
  -&gt;getStorage('node')
  -&gt;loadMultiple($ids);