title: Apollo Client 'context' does not have 'req' attribute, Cannot Access context.req.headers.authorization
body: <p>I have been working in an expo / React-Native project for quite some time, and have thus far not encountered this error often. However, recently a contracted developer pushed to an extremely depreciated branch, and long story short, all the branches essentially were un-mergable as a result.
  After resolving conflicts <strong>in the package.json file only</strong> I began getting the following error from my backend server every time I attempted a mutation.
  <code>'Error: No Auth header found'</code></p>
  <p>This is because the following authorization function was no longer clearing:</p>
  <pre><code>const checkDriverAuth = (context) =&gt; {
      const authHeader = context.req.headers.authorization
          
      if (authHeader) {
          const token = authHeader;
  
          if (token) {
              try {
                  const driver = jwt.verify(token, process.env.JWT_DRIVER_SECRET);
                  return driver;
              } catch (err) {
                  throw new AuthenticationError('Error: Invalid token');
              }
          }
          throw new Error('Error: Invalid Header, check header contents');
      }
  
      throw new Error('Error: No Auth header found');
  };
  </code></pre>
  <p>Using <code>console.log</code>s I was able to determine that upon each mutation, <code>context.req</code> is no longer even defined, so its not surprise that <code>context.req.header.authorization</code> was undefined. I attempted to solve this by deleting <code>node_modules</code> and re-running <code>npm install</code> but that did not work, I am stuck with the same issue.</p>
  <p>I am use the Apollo Middleware to interact with the backend server, and setting up the client on the frontend server looks like this...</p>
  <pre><code>// Auth for token
  const authLink = setContext((_, { headers }) =&gt; {
      const token = state
      return {
          headers: {
              ...headers,
              authorization: token ? `${token}` : ''
          }
      }
  })
  
  // Initialize Apollo Client
  const client = new ApolloClient({
      link: authLink.concat(httpLink),
      cache: new InMemoryCache(),
  });
  
  // ... other stuff //
  
  return(
    &lt;NavigationContainer&gt;
          &lt;ApolloProvider client={client}&gt;
            {/* ... A lot of other stuff */}
         &lt;/ApolloProvider&gt;
    &lt;/NavigationContainer&gt;
  </code></pre>
  <p>In truth, I know less about this than I should. I know this should (or is very close to being able to) work, but I am very unsure on  what my first steps should be to attempting to find a solution. I haven't even been able to find much helpful documentation, so even a finger in the right direction would be helpful. I would greatly appreciate an assist</p>