React Through Strack Trace Console Error when Laravel GraphQL server return categor:authorization

Hello there,

Consider my scenario of my application. Let’s say our front end application built on react-nextjs and backend in Laravel. So for frontend we are using Apollo Client and Laravel as graphQL server. So for request user data we sent also token as a variable of query/mutation. If token expired the laravel graphql return authorization as graphql category

{ "errors": [ { "message": "Unauthorized", "extensions": { "category": "authorization" }, "locations": [ { "line": 2, "column": 3 } ], "path": [ "myCloud" ], } ], "data": { "myCloud": null } }

So when this error happen the next js through a console error and also a pop-up error which is Unhandled Runtime Error - authorization.

How can we prevent the Unhandled Runtime Error - authorization ?