title: Conditional Flow Issue depending on Object Properties using Auth0 and GraphQL Authentication
body: <p>I am trying to construct a graphql context secured with Auth0 using Typescript which can support both authenticated and public routes.</p>
  
  <p>I have an authValidate function which returns an object with 3 different possibilities: 1. No token provided 2. Token is Invalid 3. Token is valid therefore can proceed to get User info</p>
  
  <p>The shape of the object thus will be one of the following...</p>
  
  <pre><code>      { error: 'No token provided' }
  
        { error:
          { JsonWebTokenError: invalid token
  
        { decoded:
          { email: 'John',
  </code></pre>
  
  <pre><code> context: async ({ req }) =&gt; {
        const { authorization: token } = req.headers;      
  
        const res: any = await isTokenValid(token);
  </code></pre>
  
  <p>I need advise on how I should code the flow. If I call res.error or res.decoded, res.error or res.decoded could be invalid either way depending on the result of the isTokenValid call</p>
  
  <p>Appreciate if someone can guide me on this. Thanks in advance </p>