How do I query entities to get all fields values - including referenced ones (INNER JOIN) I have custom content types in my Drupal 8 module and want to query nodes of those content types programmatically.

Querying through entityQuery is easy. However, I have also entity reference fields (so a node of one content type has a relation to a node of another content type).

Is there a way how to make a query that will return 'rows' of field values, exactly as when I use raw SQL INNER JOIN? I want to have an associative array of all field values, not only the specific node, but also the referenced nodes/entities.

Right now I have an own class to handle this, but it's way too much complicated and, I believe, unnecessary, so I guess I'm missing something.

Thank you.
No, there is not.

Entity query only returns IDs, you need to load those and then from there access the referenced entities.