superagent-graphql

0.1.2 • Public • Published

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)=>{
        //...
    })

Readme

Keywords

Package Sidebar

Install

npm i superagent-graphql

Weekly Downloads

3,259

Version

0.1.2

License

MIT

Last publish

Collaborators

  • 5argon