You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the redirect is hit, I'm seeing an uncaughtException rather than nextjs catching the redirect exception and handling it properly. From what I can tell this seems to be a side-effect of the way links/observables work. Perhaps the redirect isn't thrown in the correct execution stack for next to catch it properly. Is there a way to set up apollo client such that nextjs can handle navigation errors such as redirect/notFound?
The text was updated successfully, but these errors were encountered:
I think not with onError, as that will happen in parallel and not "in a line" with your promise.
Generally, to my knowledge network errors are handled centrally in Apollo Client, and will usually not make it into your result - the line of thinking here is that you should not need to handle something like a connection loss in every individual page, but only in one central place.
You could try errorPolicy: "all", in which case errors would make it into the result and could be handled there, but I'm not 100% sure if network errors will make it in there.
Thanks for your thoughts @phryneas . errorPolicy: all does not make a difference so sounds like this type of behavior is not supported / possible. Feel free to consider this closed if you'd like. I'll stick to using graphql-request for RSC funtionality
👋 I'm testing out using this library (migrating from graphq-request) and am wondering how to support a workflow I currently use.
For certain network errors, we want to redirect users. Pseudo-code is something like:
When the
redirect
is hit, I'm seeing an uncaughtException rather than nextjs catching the redirect exception and handling it properly. From what I can tell this seems to be a side-effect of the way links/observables work. Perhaps theredirect
isn't thrown in the correct execution stack for next to catch it properly. Is there a way to set up apollo client such that nextjs can handle navigation errors such asredirect
/notFound
?The text was updated successfully, but these errors were encountered: