title: How to pass request headers through to graphql resolvers
body: <p>I have a graphql endpoint which is authorised by a JWT. My JWT strategy verifies the JWT then adds the user object to the request object. </p>
  
  <p>In a restful route, I would access my users' data like so:</p>
  
  <pre><code>router.get('/', (req, res, next) =&gt; {
      console.log('user', req.user)
  }
  </code></pre>
  
  <p>I want to access req.user object within my graphql resolver in order to extract the users' ID. However, when I try log the <code>context</code> variable, it is always empty. </p>
  
  <p>Do I need to configure my graphql endpoint to pass through the <code>req</code> data to the resolver?</p>
  
  <p>My app.js has my graphql set up like this:</p>
  
  <pre><code>import { graphqlExpress, graphiqlExpress } from 'apollo-server-express';
  
  app.use('/graphql', [passport.authenticate('jwt', { session: false }), bodyParser.json()], graphqlExpress({ schema }));
  </code></pre>
  
  <p>Then I have my resolvers like so:</p>
  
  <pre><code>const resolvers = {
    Query: { 
      user: async (obj, {email}, context) =&gt; {
          console.log('obj', obj) // undefined
        console.log('email', email) // currently passed through in graphql query but I want to replace this with the user data passed in req / context
          console.log('context', context) // {}
          return await UserService.findOne(email)
      },
  };
  
  // Put together a schema
  const schema = makeExecutableSchema({
    typeDefs,
    resolvers,
  });
  </code></pre>
  
  <p>How can I access my JWT user data in my resolvers?</p>