title: Google Apps Script GraphQL API Call
body: <p>I've been working with the Canvas REST API and ran into some limitations and was directed to their experimental GraphQL API. Given its experimental nature, they have little to no documentation on it. Despite its advantages for what I'm building, I can't find a whole lot on the internet either. As of right now, I can't even get a basic query to work.</p>
  <pre><code>function testsendgraphql() {
    const url = &quot;https://hsccsd.beta.instructure.com:443/api/graphql&quot;;
    const payload = `
    query {
      course(id: 1234) {
        {
          name
        }
      }
    }`;
  
    const options = {
    &quot;method&quot;: &quot;POST&quot;,
    &quot;headers&quot;: { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Authorization&quot;: &quot;Bearer &quot;+getcanvasaccesstoken() },
    &quot;body&quot;: payload
    };
    Logger.log(query);
    apiresponse = UrlFetchApp.fetch(url,options);
    var head = apiresponse.getAllHeaders();
    var data = JSON.parse(apiresponse.getContentText());
    Logger.log(data);
    Logger.log(head);
  }
  </code></pre>
  <p>Running the above gets a response code of 200 but gives the following message:</p>
  <pre><code>{errors=[{message=No query string was present}]}
  </code></pre>
  <p>Something with my formatting of the payload seems to be off. Any help would be greatly appreciated.</p>