订阅回调仅提供基本错误消息,缺少错误代码和类型等其他详细信息,而网络选项卡显示结构正确的错误数组,这表明订阅未传输完整的错误对象
我尝试了一些改变
Add errorPolicy: 'all' in your query it will resolve your issue and will provide proper error like this:
[result][1]
this.apollo.watchQuery({
query: GET_DATA,
**errorPolicy: 'all',** // Set the desired error policy here
})
.subscribe({ //and handle this subscription part according to your version
next: (result) => {
// Handle successful response
},
error: (error) => {
// Handle error
}
});
[1]: https://i.stack.imgur.com/RTqZ0.png