express-graphql-header

1.0.1 • Public • Published

express-graphql-token

Make graphiql send token from header 'Authorization' or pass json string to set header

usage:

import express from "express"
import graphqlHTTP from "express-graphql"
import graphqlHeader from 'express-graphql-header'
 
let app = express()
// ...
app.use(path, graphqlHeader, graphqlHTTP(schema))
// ...

It will add a input element to graphiql html.

If token is a json string, it will set each key headers[key] = jsonValue, or will set headers['Authorization'] = token

Readme

Keywords

none

Package Sidebar

Install

npm i express-graphql-header

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

15.6 kB

Total Files

4

Last publish

Collaborators

  • wvqigescy