title: Empty request body when using fetch
body: <p>I'm trying to make graphql calls from a React component to a PHP server, using <code>fetch</code>. It is the first time I try using <code>fetch</code>.</p>
  
  <p>I'm using React JS on browser side and Symfony 4 on server side. However all of my calls end up with an empty body on server side, even though my browser dev tools seem to indicate data is sent.</p>
  
  <p>When using graphiql, the requests succeed. I'm trying as much as possible to mimic the graphiql request from React, but the body is always blank.</p>
  
  <p>Here is the call:</p>
  
  <pre><code>fetch('/api', {
      'method': 'post',
      'credentials': 'include',
      'headers': {
          'Content-Type': 'application/json',
      },
      'body': JSON.stringify({
          "query": "mutation {UpdateActionStatus(input: {actionId: 61, status: TO_DO}) { id }}",
          "variables": null
      }),
  }).then(r =&gt; {
      console.log(r.json());
  
      return r.json();
  }).catch(error =&gt; {
      console.log('There has been a problem with your fetch operation: ', error.message);
  });
  </code></pre>
  
  <p>I have tried with <code>mode</code> set to <code>cors</code>, <code>no-cors</code>, <code>same-origin</code>, <code>navigate</code>: none of these work.</p>
  
  <p>I have tried with Firefox and Chrome: still no luck.</p>
  
  <p>Changing the content type to <code>application/graphql</code> does not seem to work either.</p>
  
  <p>I have seen many questions dealing with empty bodies in both responses and requests when using <code>fetch</code>, on stackoverflow and elsewhere, but none of the found solutions seem to solve to my case.</p>
  
  <p>I also tried the following, much cruder call, to no avail. It seems I just cannot use fetch at all for a reason I cannot explain:</p>
  
  <pre><code>fetch('/api', {
      'method': 'post',
      'credentials': 'include',
      'headers': {
          'Content-Type': 'application/x-www-form-urlencoded',
      },
      'body': 'test=test',
  });
  </code></pre>
  
  <p>What to do? Am I missing something simple here?</p>