How to query EntryQuery for multiple sections with varying types I think the best way to pose this question is by giving an example:
Given a variable $query of type craft\elements\db\EntryQuery, I'd like to get entries from 2 different sections: &quot;people&quot; and &quot;news&quot;. Of the entries from the &quot;people&quot; section, I only want ones with entry type &quot;Employees&quot;. How would I set this up so that the &quot;type&quot; filter only applies to 1 section? If I were querying them individually, they would look like this:
$query-&gt;section('people')-&gt;type('Employees');
$query-&gt;section('insights');

How can I do this in 1 query? Thanks!
I'm not sure you can achieve this in one query.
The easiest solution I can think of to your problem requires 3 queries:
{% set peopleIds = craft.entries().section('people').type('Employees').ids() %}
{% set insightIds = craft.entries().section('insights').ids() %}
{% set query = craft.entries().id(peopleIds|merge(insightIds))

The first 2 queries are executed and return the ids of the matching entries. You can then create  your EntryQuery using the ids as the only criterion.