title: ReactJS + Apollo Client CORS Issue
body: <p>Stumped on a CORS issue while attempting to integrate GraphQL into a ReactJS application. </p>
  
  <p><strong>Situation:</strong></p>
  
  <p>I'm trying to execute a simple graphql query. No use of a database. The program works fine without graphql implementation. </p>
  
  <p><strong>Browser</strong>: Google Chrome Version 78.0.3904.87</p>
  
  <p><strong>Computer</strong>: MacBook Pro, Mid-2015</p>
  
  <p><strong>Relevant dependencies</strong>: </p>
  
  <ul>
  <li>apollo-boost: 0.4.4</li>
  <li>apollo-client: 2.6.4</li>
  <li>cors: 2.8.5</li>
  <li>express: 4.17.0</li>
  <li>graphql: 14.5.8</li>
  <li>react: 16.8.6</li>
  <li>react-apollo: 3.1.3</li>
  </ul>
  
  <p><strong>Here's the error I'm getting in the browser console:</strong></p>
  
  <blockquote>
    <p>OPTIONS <a href="http://localhost:5000/graphql" rel="nofollow noreferrer">http://localhost:5000/graphql</a> net::ERR_CONNECTION_REFUSED</p>
  </blockquote>
  
  <p><strong>See the repository/directory structure here:</strong></p>
  
  <p><a href="https://github.com/curtisyungen/hh-graphql" rel="nofollow noreferrer">https://github.com/curtisyungen/hh-graphql</a></p>
  
  <p><strong>Here's a look at my server.js file:</strong> </p>
  
  <pre><code>const express = require("express");
  const graphqlHTTP = require('express-graphql');
  const schema = require('./src/graphql/schema');
  const cors = require('cors');
  
  const PORT = 5000;
  
  const app = express();
  
  app.use(cors());
  app.use('/graphql', graphqlHTTP({
      schema, 
      graphiql: true,
  }));
  
  app.listen(PORT, () =&gt; {
      console.log(`Listening on port ${PORT}. Visit http://localhost:${PORT}/ in your browser.`);
  });
  
  module.exports.app = app;
  </code></pre>
  
  <p><strong>Here's how I'm setting up the Apollo Client in my App.js file:</strong> </p>
  
  <pre><code>const cache = new InMemoryCache();
  const link = new HttpLink({
    uri: 'http://localhost:5000/graphql'
  });
  
  const client = new ApolloClient({
    cache,
    link,
  });
  </code></pre>
  
  <p><strong>Here is a screenshot of the Network tab in the browser:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/45qit.png" rel="nofollow noreferrer">Screenshot of Network Tab in Browser</a></p>
  
  <p>I've scoured the internet for solutions and have tried the following:</p>
  
  <ul>
  <li>app.use(cors());</li>
  <li>adding fetchOptions: { mode: 'no-cors' } to Apollo Client</li>
  <li>adding Access-Control-Allow-Origin extension to Chrome</li>
  <li>using local IP address in lieu of 'localhost'</li>
  </ul>
  
  <p>I was following a YouTube tutorial where the guy solved this issue by importing cors. It worked for him but not for me...any ideas?</p>