【发布时间】:2020-01-14 00:38:38
【问题描述】:
我在 Angular 应用程序中使用的 apollo 客户端有问题。我正在调用一个 graphQL-Query,它返回以下内容:
account: {id: 1}
accountId: 1
contact: {id: 1}
contactId: 1
id: 23
notes: null
resultId: null
stepId: 1
subject: "testsubject"
我在浏览器开发者工具中看到了这个结果(调用结果预览) 到目前为止一切顺利,但 appolo-client 会返回:
account: {id: 1}
accountId: 1
contact: {id: 1}
contactId: 1
id: {id: {…}, notes: null, stepId: 1, subject: "testsubject", resultId: null, …}
notes: null
resultId: null
stepId: 1
subject: "testsubject"
我在网上搜索过这个问题,但似乎我是唯一一个有这个问题的人,尝试了几乎类似问题的解决方案并没有解决任何问题。
禁用缓存并没有解决它
this.apollo.create({
link: from([this.logoutLink, this.authMiddleware, graphQLDataLink]),
cache: new InMemoryCache({
addTypename: false
}),
defaultOptions: {
query: {
fetchPolicy: 'no-cache'
}
}
}
【问题讨论】:
标签: angular apollo-client