title: Apollo Server timeout while waiting for stream data
body: <p>I'm attempting to wait for the result of a stream with my Apollo Server. My resolver looks like this.</p>
  
  <pre><code>async currentSubs() {
    try {
      const stream = gateway.subscription.search(search =&gt; {
        search.status().is(braintree.Subscription.Status.Active);
      });
      const data = await stream.pipe(new CollectObjects()).collect();
      return data;
    } catch (e) {
      console.log(e);
      throw new Meteor.Error('issue', e.message);
    }
  },
  </code></pre>
  
  <p>This resolver works just fine when the data stream being returned is small, but when the data coming in is larger, I'm getting a <code>503 (Service Unavailable)</code>. I looks like the timeout is happening around 30 seconds. I've tried increasing the timeout of my Express server with <code>graphQLServer.timeout = 240000;</code> but that hasn't made a difference.</p>
  
  <p>How can I troubleshoot this &amp; where is the 30 second timeout coming from? It only fails when the results take longer.</p>
  
  <p>I'm using <a href="https://github.com/mrdaniellewis/node-stream-collect" rel="noreferrer">https://github.com/mrdaniellewis/node-stream-collect</a> to collect the results from the stream.</p>
  
  <p>Error coming in from the try catch:</p>
  
  <pre><code>I20180128-13:09:26.872(-7)? { proxy:
  I20180128-13:09:26.872(-7)?    { error: 'Post http://127.0.0.1:26474/graphql: net/http: request canceled (Client.Timeout exceeded while awaiting headers)',
  I20180128-13:09:26.872(-7)?      level: 'error',
  I20180128-13:09:26.873(-7)?      msg: 'Error sending request to origin.',
  I20180128-13:09:26.873(-7)?      time: '2018-01-28T13:09:26-07:00',
  I20180128-13:09:26.873(-7)?      url: 'http://127.0.0.1:26474/graphql' } }
  </code></pre>