JSON parse error when using OAuth token
Open
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
I've got this to work using Postman, however the following code generates a JSON parse error?
## Code
```js
const graphql = require('graphql.js');
const graph = graphql('https://api.github.com/graphql', {
method: "POST",
headers: {
"User-Agent": "node",
"Authorization": "Bearer "
}
});
const query = graph(`query { viewer { login name } }`);
query().then(
res => console.log(JSON.stringify(res)),
err => console.error(err)
);
```
## Error
```sh
{ message: 'Problems parsing JSON',
documentation_url: 'https://developer.github.com/v4' }
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.