title: react firebase authentication with apollo graphql
body: <p>I have found a great article adding authentication into react.
  Article: <a href="https://www.robinwieruch.de/complete-firebase-authentication-react-tutorial/" rel="nofollow noreferrer">https://www.robinwieruch.de/complete-firebase-authentication-react-tutorial/</a></p>
  
  <p>This article finishes the firebase setup (before redux) with a HOC component that I can put into the app and can access with context.</p>
  
  <p>My issue is how do i put this into the apollo client which is outside of the app component so even with the context I cant set it.  I have this same problem with redux.  Only one I have found is use local storage but I would like to avoid that.</p>
  
  <p>This is my apollo client in the main app component.</p>
  
  <pre><code>const client = new ApolloClient({   
      uri: clientUrl,
    request: async operation =&gt; {
          const token = How_do_i_set_this &lt;-- ???
          console.log('token in request', token)
      operation.setContext({
        headers: {
          authorization: token ? `Bearer ${token}` : ''
        }
      });
      }
  });
  
  const App = () =&gt; (
      &lt;DashAppHolder&gt;
          &lt;ApolloProvider client={client}&gt;
              &lt;Provider store={store}&gt;
                  &lt;PublicRoutes history={history} /&gt;
              &lt;/Provider&gt;
          &lt;/ApolloProvider&gt;
      &lt;/DashAppHolder&gt;
  );
  </code></pre>