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
I am using Apollo-Client React to receive data from a GraphQL Subscription server (Implemented with NestJs/Apollo). In order to implement authorization, I throw error in the server side. Now, I need to catch the error in the front-end so I can notify the user. But I do not know how can I catch it.
My best solution is to use following:
This way I get the error int the error property. But I need the event. I have use onError on many hooks and objects. In the useSubscription, in the WebSocketLink and in the ApolloClient, but none has worked.
Please guide me how can I catch the error event. Or give me any relevant documentation.
The text was updated successfully, but these errors were encountered:
This seems to have been fixed in #9495 - @afsharm let us know if you're still experiencing this issue with the latest release and we'll re-open. Thanks so much for opening this issue!
I am using Apollo-Client React to receive data from a GraphQL Subscription server (Implemented with NestJs/Apollo). In order to implement authorization, I throw error in the server side. Now, I need to catch the error in the front-end so I can notify the user. But I do not know how can I catch it.
My best solution is to use following:
const { data, loading, error } = useSubscription(..)
This way I get the error int the
error
property. But I need the event. I have useonError
on many hooks and objects. In theuseSubscription
, in theWebSocketLink
and in the ApolloClient
, but none has worked.Please guide me how can I catch the error event. Or give me any relevant documentation.
The text was updated successfully, but these errors were encountered: