title: How to pass arguments to graphqlHTTP middleware
body: <p><strong><em>how can i pass arguments to graphqlHTTP middleware</em></strong></p>
  
  <p>I'm trying to pass Authorization header token payload to graphqlHTTP middleware from another upper level middleware</p>
  
  <pre><code>app.use('/private', (req:Request,res:Response,next:Function) =&gt; {
  
     if(!req.header('Authorization')){
        res.json({
           error:true,
           message:'Authorization bearer required'
        })
     }else{
        const token = Buffer.from(req.header('Authorization').split('Bearer ')[1], 'base64').toString('ascii');
        if(decode(token)){
           next();
        }else{
           res.json({
              error:true,
              message:'Authorization bearer required'
           })
        }
     }
  });
  
  app.use('/private', graphqlHTTP({
     schema:privateSchema,
     graphiql:false
  }))
  </code></pre>