graphql-tester icon indicating copy to clipboard operation
graphql-tester copied to clipboard

be able to pass in custom headers

Open hinling-ihealthlabs opened this issue 7 years ago • 3 comments

our graphql requires a couple of custom headers for authentication. Would be nice to be able to pass in custom headers through _ref.

hinling-ihealthlabs avatar Mar 31 '17 18:03 hinling-ihealthlabs

you can pass auth:

const {tester} = require('graphql-tester')
const myAuthToken = 'HFJGHGFJHFGJ456456456456'

const test = tester({
  url: 'http://localhost:3000/graphql',
  contentType: 'application/json',
  authorization: myAuthToken,
})

msmfsd avatar Apr 13 '18 05:04 msmfsd

but can you pass other stuff? Like `const {tester} = require('graphql-tester') const myAuthToken = 'HFJGHGFJHFGJ456456456456' const mySmthElse = 'somethingElse'

const test = tester({ url: 'http://localhost:3000/graphql', contentType: 'application/json', authorization: myAuthToken, x-smth-else: mySmthElse, })`

mateusrdp avatar Sep 14 '18 11:09 mateusrdp

@mateusrdp not sure, try it and see or pm repo owner

msmfsd avatar Sep 18 '18 00:09 msmfsd