title: How to pass Request cookies through node-fetch in isomorphic app?
body: <p>I'm trying to build isomorphic project using React, Express and isomorphic fetch (based on <code>whatwg-fetch</code> on client and <code>node-fetch</code> on server), from <a href="https://github.com/kriasoft/react-starter-kit" rel="nofollow">this</a> common boilerplate. I'm using cookies for my access token, and <code>credentials: 'same-origin'</code> on front-end side <a href="https://github.com/github/fetch#sending-cookies" rel="nofollow">to send it</a> to GraphQL -- works pretty well.</p>
  
  <p>The problem is that I can't use the same solution for server side -- <code>node-fetch</code> just don't support using of XMLHttpRequest cookies from the box. My fetch request is under few abstract layers from router, so I can't just use cookie value from <code>req</code>. </p>
  
  <p>Here is my <code>server.js</code> code (<a href="https://gist.github.com/be8dbc8fc688f6cd774d68ae92182fe4" rel="nofollow">full version</a>):</p>
  
  <pre><code>server.get('*', async (req, res, next) =&gt; {
    try {
      // some presettings here..
  
      await Router.dispatch({ path: req.path, query: req.query, context }, (state, component) =&gt; {
        data.body = ReactDOM.renderToString(component);
      });
  
      res.send(template(data));
    } catch (err) {
      next(err);
    }
  });
  </code></pre>
  
  <p>and Route's <code>index.js</code> (<a href="https://gist.github.com/a55c83b42218e3e079ee0ae5d36cd2e6" rel="nofollow">full version</a>):</p>
  
  <pre><code>export const action = async (state) =&gt; {
    const response = await fetch('/graphql?query={me{id,email}}', {
      credentials: 'same-origin',
    });
    const { data } = await response.json();
    // ...
    return &lt;Login title={title} me={data.me} /&gt;;
  };
  </code></pre>
  
  <p>How can I pass my token from server.js to my fetch module? Or, maybe there are some better decisions?</p>