【发布时间】:2020-08-08 03:38:47
【问题描述】:
我正在学习 React/Apollo,当我引入错误时,我的 Chrome 控制台中出现了典型的红色异常。但是,对于 Apollo,它并没有像在 React 或其他框架中那样告诉我错误是从哪里在我的代码中开始的。当使用在多个组件中触发查询的钩子时,查找问题根源的速度非常慢。
您是否使用任何技巧来调试您的 Apollo 代码,或者您能否以某种方式改进错误反馈?
这是我看到的:
ApolloError.ts:46 Uncaught (in promise) Error: GraphQL error: User is not authenticated
at new ApolloError (ApolloError.ts:46)
at QueryManager.ts:1241
at Object.next (Observable.js:322)
at notifySubscription (Observable.js:135)
at onNotify (Observable.js:179)
at SubscriptionObserver.next (Observable.js:235)
at observables.ts:12
at Set.forEach (<anonymous>)
at Object.next (observables.ts:12)
at notifySubscription (Observable.js:135)
at onNotify (Observable.js:179)
at SubscriptionObserver.next (Observable.js:235)
at httpLink.ts:142
【问题讨论】:
标签: react-hooks react-apollo apollo-client react-apollo-hooks