title: Use jq to collect recursive-descent results into a single array
body: <p>Is it possible to collect <a href="https://stedolan.github.io/jq/manual/#TypesandValues" rel="nofollow noreferrer">recursive-descent</a> results into a single array with <code>jq</code>? </p>
  
  <p>Would <code>flatten</code> help? Looks so to me, but I just cannot get it working. Take a look how far I am now at <a href="https://jqplay.org/s/6bxD-Wq0QE" rel="nofollow noreferrer">https://jqplay.org/s/6bxD-Wq0QE</a>, anyone can make it working? </p>
  
  <p>BTW,</p>
  
  <ul>
  <li><code>.data.search.edges[].node | {name, topics: ..|.topics?}</code> works, but I want all topics from the same node to be in one array, instead of having same <code>name</code> in all different returned results. </li>
  <li><code>flatten</code> alone will give me <code>Cannot iterate over null</code>, and</li>
  <li>that's why I'm trying to use <code>map(select(.? != null))</code> to filter the <code>null</code>s out. However, I'd get <code>Cannot iterate over null</code> as well for my <code>map-select</code>. </li>
  </ul>
  
  <p>So now it all comes down to how to filter out those <code>null</code>s?</p>
  
  <p><strong>UPDATE:</strong>, by <em>"collect into a single array"</em> I meant to get something like this:</p>
  
  <pre><code>[
    {
      "name": "leumi-leumicard-bank-data-scraper",
      "topics": ["banking", "leumi", "api", "puppeteer", "scraper", "open-api"]
    }
  ]
  </code></pre>
  
  <p>instead of having same <code>name</code> duplicated in all different returned results. Thus recursively descends seems to me to be the option, but I'm open to any solution as long as I can get result like above. Is that possible? Thx. </p>