EntityQuery with a condition on an array I try to list all fields where a paragraph type is referenced (to find all contents which have paragraphs of a specific type).

My problem: I do a EntityQuery on field_config entity type to find the fields. But, the condition on which paragraph_type are targeted doesn't work correctly and return all fields which can content a paragraph disregarding the type. 

Here my code:

// Recover my paragraph_type selected in my form.
$paragraph_type = $form_state-&gt;getValue('paragraph_type');

// List all field_config which referred this paragraph_type.
$query = \Drupal::entityQuery('field_config')
  -&gt;condition('field_type', 'entity_reference_revisions')
  -&gt;condition('settings.handler', 'default:paragraph')
  -&gt;condition('settings.handler_settings.target_bundles', $paragraph_type, 'IN');

$field_config = $query-&gt;execute();


For exemple, I have a paragraph type "press_release_about" which can be add only in press release in a specific field. But for this paragraph (and all others), it's all fields which can contains a paragraph in the system which are returned.

When I inspect a field_config which referred paragraph, I can see that settings.handler_settings.target_bundles is an array of the paragraph types which can be add with this field. The format is:

[settings:protected] =&gt; Array
    (
        [handler] =&gt; 'default:paragraph'
        [handler_settings] =&gt; Array
            (
                [target_bundles] =&gt; Array
                    (
                        [1col_text] =&gt; 1col_text
                        [1col_image] =&gt; 1col_image
                        [1col_quote] =&gt; 1col_quote
                        [1_col_graphique] =&gt; 1_col_graphique
                        [2_cols_texte_media] =&gt; 2_cols_texte_media
                        [2_cols_texte_graphique] =&gt; 2_cols_texte_graphique
                        [2_cols_text] =&gt; 2_cols_text
                    )
              )
         )


If I remove the condition -&gt;condition('settings.handler_settings.target_bundles', $paragraph_type, 'IN'), this change nothing. And if I change the INby NOT IN, I have no result.

I don't know if I don't write my condition correctly or if my error is elsewhere.
try to use an array instead of the value of $paragraph_type.

that would be like this :

-&gt;condition('settings.handler_settings.target_bundles', [$paragraph_type], 'IN')