How to filter paragraphs by the field name on parent using entityQuery? I have a paragraph type my_paragraph which is attached to a node type my_content_type on multiple fields like field_a, field_b, field_c, field_d. I want to load only those attached to some specific fields, let's say field_a and field_c. I am using entityQuery, but open to other suggestions.
The entity/field structure is like:
my_content_type: Node
|_ field_a: Paragraph (type: my_paragraph)
|_ field_b: Paragraph (type: my_paragraph)
|_ field_c: Paragraph (type: my_paragraph)
|_ field_d: Paragraph (type: my_paragraph)

My code which loads all paragraphs of type:
\Drupal::entityQuery('paragraph')
  -&gt;condition('type', 'my_paragraph')
  // Here I want to filter by the field name on the parent entity
  -&gt;condition('PARENT_FIELD', ['field_a', 'field_c'], 'IN')
  // Some more conditions out of context
  -&gt;condition('out_of_context_field', $out_of_context_value)
  -&gt;execute();

Is there any entity query condition I can use here?
Specifically with Paragraphs there are three extra fields directly on Paragraph level, which are accessible with EntityQuery: parent_id, parent_type (entity type like &quot;node&quot;, not bundle name like &quot;page&quot;), parent_field_name
You can use those three with EQ like a normal field, e.g.
-&gt;condition('parent_field_name', ['field_a', 'field_c'], 'IN')

Notice that those three fields are only available for Paragraphs, it will not work with any other entity type.