1.0.1 • Published 4 years ago

express-graphql-header v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

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.

npm.io

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