title: GraphQL Error : Method not allowed. Must be one of: OPTIONS
body: <p>I am new with GraphQL. I need to make an API with PHP and GraphQL.
  I followed this tutorial:
  <a href="https://medium.com/swlh/setting-up-graphql-with-php-9baba3f21501" rel="nofollow noreferrer">https://medium.com/swlh/setting-up-graphql-with-php-9baba3f21501</a></p>
  <p>everything was OK, but when opening the URL, I got this error:</p>
  <pre><code>{
      &quot;statusCode&quot;: 405,
      &quot;error&quot;: {
          &quot;type&quot;: &quot;NOT_ALLOWED&quot;,
          &quot;description&quot;: &quot;Method not allowed. Must be one of: OPTIONS&quot;
      }
  }
  </code></pre>
  <p>I added this to the index page :</p>
  <pre><code> header('Access-Control-Allow-Origin', '*');
   header('Access-Control-Allow-Headers', 'content-type');
   header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
  </code></pre>
  <p>but the problem wasn't resolved.
  Maybe something is missing here:</p>
  <pre><code>return function (App $app) {
      $app-&gt;options('/{routes:.*}', function (Request $request, Response $response) {
          // CORS Pre-Flight OPTIONS Request Handler
          return $response;
      });
  </code></pre>