Answers.Body: <p>You can use the <code>level()</code> parameter (<a href="https://craftcms.com/docs/3.x/entries.html#level" rel="nofollow noreferrer">docs</a>) on your query:</p>
  <pre class="lang-twig prettyprint-override"><code>{% set entries = craft.entries()
      .section('yourSectionHandle')
      .level(1)
      .all() %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-16T06:30:31.887Z
Answers.Text: Thank you so much @Oli. I really appreciate your help. Thank you again.
Answers.UserDisplayName: sam
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-16T02:07:26.613Z
Answers.LastActivityDate: 2021-09-16T02:07:26.613Z
Answers.UserDisplayName: Oli
Body: <p>Suppose I have a structure Section with Entries like this:</p>
  <ul>
  <li>Parent A
  <ul>
  <li>Child X</li>
  </ul>
  </li>
  <li>Parent B</li>
  <li>Parent C
  <ul>
  <li>Child Y</li>
  </ul>
  </li>
  </ul>
  <p>How would I return this list of Entries?</p>
  <pre><code>[Parent A, Parent B, Parent C]
  </code></pre>
  
Tags: <craft3><structure><elementquery>
Title: Is there a way to query for structure Entries that have no Parent?
ThreadText: # Is there a way to query for structure Entries that have no Parent?
  
  (Asked by: username_0 on 2021-09-15)
  
  Suppose I have a structure Section with Entries like this:
  
  * Parent A
    + Child X
  * Parent B
  * Parent C
    + Child Y
  
  How would I return this list of Entries?
  
  ```
  [Parent A, Parent B, Parent C]
  
  ```
  
  **Tags:** craft3, structure, elementquery
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-09-16. Score: 2
  
  You can use the `level()` parameter ([docs](https://craftcms.com/docs/3.x/entries.html#level)) on your query:
  
  ```twig
  {% set entries = craft.entries()
      .section('yourSectionHandle')
      .level(1)
      .all() %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you so much @username_1. I really appreciate your help. Thank you again.  
  
  ---
  
  