By hari, 19 October, 2023 <?php # If you write it as an entity query then you can cast it to a string, like this: $query = \Drupal::entityTypeManager() ->getStorage('taxonomy_term') ->getQuery() ->condition('vid', 'test') ->condition('name', 'test'); var_export((string) $query); Tags Drupal