title: Providing query string to fetch from a GraphQL API
body: <p>I am attempting to fetch some data from a GraphQL endpoint, however I keep getting the error "Must provide query string". I am sure I am providing the query string, where does this error come from?</p>
  
  <p>The endpoint is: <a href="https://antserver-blocjgjbpw.now.sh/graphql" rel="nofollow noreferrer">https://antserver-blocjgjbpw.now.sh/graphql</a> </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const query = `{
      ants {
      name
      color
      length
      weight
      }
  }`
  
  document.getElementById("basicFetchButton").addEventListener("click", () =&gt; {
   fetch("https://antserver-blocjgjbpw.now.sh/graphql", {
     method: 'POST',
    'Content-Type': 'application/graphql',
      body: JSON.stringify({query})
    })
    .then(res =&gt; res.json())
    .then(data =&gt; console.log(data))
  })</code></pre>
  </div>
  </div>
  </p>