superagent-graphql
v0.1.2
Published
Shortcut plugin for making a GraphQL query with SuperAgent
Downloads
11,903
Readme
#Superagent Suffix Middleware Middleware to add a suffix to superagent request url
##Installation
npm install --save superagent-graphql
##Example
var request = require('superagent');
var ql = require('superagent-graphql');
const queryString = `
query Authenticate($id: String!, $password : String!)
{
authenticate(id: $id, password: $password)
}
`
const queryVars = {
id: "123",
password: "456"
}
request
.post("/graphql")
.use(ql(queryString,queryVars))
.end((err,res)=>{
//...
})