title: Next.JS: Resolver with promise doesn't work in api-routes-server-and-client-test on SSR
body: <p>Using next.js example <a href="https://github.com/zeit/next.js/tree/canary/examples/api-routes-apollo-server-and-client" rel="noreferrer">api-routes-apollo-server-and-client</a>. When I'm trying to implement delay in <code>apollo/resolvers.js</code> this way:</p>
  
  <pre><code>export const resolvers = {
    Query: {
      viewer (_parent, _args, _context, _info) {
        return new Promise((resolve, reject) =&gt; {
          setTimeout(() =&gt; {
            resolve({ id: 1, name: 'John Smith', status: 'cached' });
          }, 1000);
        })
      }
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Eziry.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Eziry.png" alt="enter image description here"></a></p>
  
  <p>This doesn't work in SSR. The data is empty in the SSR apollo state but user data expected <code>{ id: 1, name: 'John Smith', status: 'cached' }</code>.</p>
  
  <p>I'm using that also with sequelize to fetch the data from database and it doesn't work too. I guess the reason is the same.</p>
  
  <p>Maybe I'm doing something wrong.</p>
  
  <p>Client-side part works fine (data are displayed after React hydratation).</p>
  
  <p>If we're doing static object instead of Promise:</p>
  
  <pre><code>export const resolvers = {
    Query: {
      viewer (_parent, _args, _context, _info) {
        return { id: 1, name: 'John Smith', status: 'cached' };
      }
    }
  }
  </code></pre>
  
  <p>Everything works fine and this puts object to initial state returned from SSR server with correct static markup...</p>
  
  <p><a href="https://i.stack.imgur.com/AXfV3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AXfV3.png" alt="enter image description here"></a></p>
  
  <p><strong>What am I expecting?</strong></p>
  
  <p>I want just server render graphql requiest, finish promises, the put the data to apollo state for SSR and does the SSR for SEO purposes. Because for now if I connect to the database - it doesn't work at all (nothing's rendered. just empty page because rendering was interrupted by something).</p>