Node-Github-GraphQL
A GitHub GraphQL HTTP wrapper
Table of contents
Installation
npm install node-github-graphql --save
Basic Example
var GithubGraphQLApi = var github = token: processenvGITHUB_API_TOKENgithub
Advanced Example
var GithubGraphQLApi = var github = Promise: token: processenvGITHUB_API_TOKEN userAgent: 'Hello' // Optional, if not specified, a default user agent will be used debug: truegithub
API Reference
new GithubGraphQLApi(options)
- options
Type: objects
The accepted keys are as below:
Key | Value |
---|---|
Promise/promise | The promise object |
token | Github API key(Mandatory) |
debug | To turn on debug log (boolean) |
userAgent | User-Agent if specified |
url | Alternative url to send the request |
github.request(query, variables, callback)
- query
Type: string
GraphQL query
- variables (optional)
Type: object
Dynamic arguments to be passed inside the query string. See http://graphql.org/learn/queries/#variables
- callback (optional)
Type: function (string response, string error)
If callback is specified, it will be used instead of promises.
LICENSE
MIT license. See the LICENSE file for details.