title: GraphQL API works with Postman, but failed with Javascript fetch
body: <p>I built a GraphQL server as follows,</p>
  
  <pre><code>import express from 'express';
  import graphqlHTTP from 'express-graphql';
  import { schema } from './data/schema';
  
  const app = express();
  
  app.use(express.static(__dirname + '/public'));
  app.get('/', function(req, res) {
    res.sendFile('index.html');
  });
  
  app.use('/graphql', graphqlHTTP({
    schema: schema,
    graphiql: true
  }));
  
  app.listen(8081, () =&gt; {
    console.log('Running server on port localhost:8081/graphql');
  });
  </code></pre>
  
  <p>And I can make a POST call from Postman like below,</p>
  
  <p><a href="https://i.stack.imgur.com/Vge3c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vge3c.png" alt="enter image description here"></a></p>
  
  <p>However, when I try to call the API with fetch in the app.js file which is loaded in the index.html as follows,</p>
  
  <pre><code>function fetchQuery(query) {
    return fetch('/graphql', {
      method: 'POST',
      header: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ query })
    }).then(response =&gt; {
      return response.json();
    });
  }
  const query = `{
    friend {
      firstName
    }
  }`;
  
  fetchQuery(query).then((data) =&gt; {
    console.log(data);
  });
  </code></pre>
  
  <p>It says the following errors,<br>
  app.js:2 POST <a href="http://localhost:8081/graphql" rel="nofollow noreferrer">http://localhost:8081/graphql</a> 400 (Bad Request)<br>
  and response error message: "Must provide query string."</p>