title: Merging 2 REST endpoints to a single GraphQL response
body: <p>New to graphQL, I'm Using the following schema:</p>
  
  <pre><code>type Item {
      id: String,
      valueA: Float,
      valueB: Float
    }
  
    type Query {
      items(ids: [String]!): [Item]
    }
  </code></pre>
  
  <p>My API can return multiple items on a single request of each type (A &amp; B) but not for both, i.e:  </p>
  
  <p>REST Request for typeA : <code>api/a/items?id=[1,2]</code><br>
  Response: </p>
  
  <pre><code>[
    {"id":1,"value":100},
    {"id":2,"value":30}
  ]
  </code></pre>
  
  <p>REST Request for typeB : <code>api/b/items?id=[1,2]</code><br>
  Response: </p>
  
  <pre><code>[
    {"id":1,"value":50},
    {"id":2,"value":20}
  ]
  </code></pre>
  
  <p>I would like to merge those 2 api endpoints into a single graphQL Response like so:</p>
  
  <pre><code>[
    {
      id: "1",
      valueA: 100,
      valueB: 50
     },
     {
      id: "2",
      valueA: 30,
      valueB: 20
      }
   ]
  </code></pre>
  
  <hr>
  
  <p><strong>Q:</strong> How would one write a resolver that will run a <strong>single</strong> fetch for each type (getting multiple items response) making sure no unnecessary fetch is triggered when the query is lacking the type i.e:</p>
  
  <pre><code>{items(ids:["1","2"]) {
    id
    valueA
  }}
  </code></pre>
  
  <p>The above example should only fetch <code>api/a/items?id=[1,2]</code> and the graphQL response should be:</p>
  
  <pre><code>[
    {
      id: "1",
      valueA: 100
    },
    {
      id: "2",
      valueA: 30
    }
  ]
  </code></pre>