Apollo / GraphQL Hangs on Unauthenticated API Call

I recently added Auth0 Authentication to my Redwood app, following the reference instructions (Auth0 Authentication | RedwoodJS Docs). My authentication works perfectly, however if I’m not logged into the app my GraphQL requests are hanging for 60 seconds before they are fired off. The request themselves are tiny (a single line of text from a table with one row) and are marked to skip authentication.

To try to figure out what was going on, I removed useAuth from the RedwoodApolloProvider in my app.tsx (<RedwoodApolloProvider useAuth={useAuth}>). This resolves the issue, but stops the authentication from being passed to Apollo / GraphQL for other API requests. My quesiton is, am I missing some sort of configuration on the configuratio of the RedwoodApolloProvider for unauthenticated scenarios?

Might you have you app in a public repo we can look at?

Thanks!

You may also want to setup some logging both in the service and within the GraphQL handler.

See: GraphQL | RedwoodJS Docs

Sorry for the delay, here’s a stripped down project that shows the issue.

Github Repo: GitHub - levisiebens/Auth0RedwoodExample

To create the project I did the following:

  1. Created an empty redwood project (targets a local sqlite Db)
  2. Created the home page
  3. Added the post object from the tutorial (schema / scaffold) and created one post. Then I added the PostsCell to the homepage.
  4. Added tailwind and Auth0, setting it up like my other project.
  5. Added the correct environment variables in the redwood.toml file (I removed the keys from the project to not share them)

Before adding the Auth0 provider, the project would load just fine. After adding the provider, the PostsCell will sit for 60 seconds before finally timing out and saying “You don’t have permissions to do that”.

Did you also set the proper env variables for your Auth0 account?

Yes, I set those in both the toml and in my .env file. I can authenticate and once I do, the issue then doesn’t occur.