Entity Query Condition for the referenced entity's type According to the documentation for the condition() function, you can append columns to a field name, but I haven't found a way to make a condition on the referenced entity's type.

// Something like this?
$query-&gt;andConditionGroup()-&gt;condition($referenceFieldName, $someId)
     -&gt;condition("$fieldName.entity:type", ['character', 'movie'], 'IN')


Let's say with the above I am querying for articles that have a reference to the ID in $someId and that reference is to a content type of either character or movie. Is something like this possible with entityQuery?

Background: I'm using the Dynamic Entity Reference module, which allows me to make a reference field that can point to either a taxonomy term or a piece of content. I want to query for references to content in that field, but am concerned that there could be an ID overlap. That is, a taxonomy term and character for example that both have the ID 123. If I am searching for the ID 123, I would only want articles that have references to the characters or movies with the ID 123, not any taxonomy terms with the ID 123.
since the reference field is using DER, you can use $fieldName.target_type for finding the referenced entity's type.