/*
  Simple GraphQL transport which send queries to a GraphQL endpoint
*/
function GraphQLTransport(path) {
  this.path = path || "/graphql";
}

GraphQLTransport.prototype.sendQuery = function (query, vars) {
  vars = vars || {};
  return new Promise((resolve, error) => {
    // use fetch to get the result
    fetch(this.path, {
      method: 'post',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        query,
        vars
      })
    })
    // get the result as JSON
    .then(res => res.json())
    // trigger result or error
    .then(response => {
      if(response.errors) {
        return error(response.errors);
      }

      return resolve(response.data);
    })
    .catch(error);
  });
};

@@ -202,16 +202,35 @@
 vars) %7B%0A
+  var self = this;%0A
   vars =
@@ -263,16 +263,24 @@
 Promise(
+function
 (resolve
@@ -285,17 +285,15 @@
 ve, 
-error) =%3E
+reject)
  %7B%0A 
@@ -336,20 +336,20 @@
   fetch(
-this
+self
 .path, %7B
@@ -595,14 +595,36 @@
 hen(
-res =%3E
+function(res) %7B%0A      return
  res
@@ -630,16 +630,23 @@
 s.json()
+;%0A    %7D
 )%0A    //
@@ -664,21 +664,22 @@
 sult or 
-error
+reject
 %0A    .th
@@ -681,24 +681,33 @@
   .then(
+function(
 response
  =%3E %7B%0A  
@@ -702,11 +702,9 @@
 onse
- =%3E
+)
  %7B%0A 
@@ -745,21 +745,22 @@
  return 
-error
+reject
 (respons
@@ -834,21 +834,22 @@
  .catch(
-error
+reject
 );%0A  %7D);

Remove ES2015 code from the graphql_transport