title: Typescript: 'Promise<any[]>' is not assignable to type
body: <p>My interface:</p>
  
  <pre class="lang-js prettyprint-override"><code>interface MeetingAttributeRecords {
    branches: Array&lt;Promise&lt;any&gt;&gt;;
    worshipStyles: Array&lt;Promise&lt;any&gt;&gt;;
    accessibilities: Array&lt;Promise&lt;any&gt;&gt;;
  }
  </code></pre>
  
  <p>A simplified version of my controller:</p>
  
  <pre class="lang-js prettyprint-override"><code>export const getAllMeetings = async (req, res) =&gt; {
    const meetings = await query(
      `SELECT * FROM meeting;`
    );
  
    const promises: MeetingAttributeRecords = getMeetingAttributeRecords(meetings);
  
    Promise.all([
      Promise.all(promises.worshipStyles),
      Promise.all(promises.branches),
      Promise.all(promises.accessibilities)
    ]).then(() =&gt; {
      res.json({ meetings: meetings.rows });
    });
  };
  </code></pre>
  
  <p>And the utility function that runs some additional queries, returning promises:</p>
  
  <pre class="lang-js prettyprint-override"><code>export async function getMeetingAttributeRecords(meetings) {
  
    const branches = await meetings.rows.map(async (meeting) =&gt; {
      const branch = await query(
        // SQL CODE
      );
      return meeting.branch = branch.rows;
    });
  
    const worshipStyles = await meetings.rows.map(async (meeting) =&gt; {
      const ws = await query(
        // SQL CODE
      );
      return meeting.worship_style = ws.rows;
    });
  
    const accessibilities = await meetings.rows.map(async (meeting) =&gt; {
      const access = await query(
        // SQL CODE
      );
      return meeting.accessibility = access.rows;
    });
  
    return [branches, worshipStyles, accessibilities];
  }
  </code></pre>
  
  <p>And I'm seeing the following Typescript errors: </p>
  
  <pre class="lang-js prettyprint-override"><code>[ts]
  Type 'Promise&lt;any[]&gt;' is not assignable to type 'MeetingAttributeRecords'.
    Property 'branches' is missing in type 'Promise&lt;any[]&gt;'.
  </code></pre>
  
  <p>I've been scouring the documentation and help articles for a while now, but no dice. Does anyone have insight into this?</p>
  
  <p>Let me know if there are any other details you need!</p>