f / graphql.js

A Simple and Isomorphic GraphQL Client for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.then is not a function

diit opened this issue · comments

Context

var graphql = require('graphql.js')

var graph = graphql('someurl, {
  headers: {
    'Authorization': `Bearer XXX`,
    'Content-Type': 'application/json'
  }
}

function getX() {
  return graph('query me { name }')
}

getX().then(me => {
  console.log(me)
})

All bundled with webpack, errors on .then call and add the graph.query('...') does not seem to affect a change.

Expected Result

  • Console logs data

Actual Result

  • Error on .then
  • No network requests made

That worked!