angular - "this.apollo is undefined" & "Cannot read property 'use' of undefined" when the query is moved to a separate Angular package
问题描述
I used to have this graphql query inside my Angular app which used to work properly. Now that I have moved it to an external library, I get the following error in my chrome console:
application.js:198 TypeError: Cannot read property 'use' of undefined
at FetchIntegrationsInformationGQL../node_modules/apollo-angular/fesm5/ngApollo.js.Query.fetch (ngApollo.js:260)
Other browser:
TypeError: "this.apollo is undefined"
query FetchIntegrationsInformation(
$accountPk: PK!
$workspacePk: PK!
) {
currentUser {
id
account(pk: $accountPk) {
id
activeSubscription {
basis
}
workspace(pk: $workspacePk) {
id
studies(states: [ORDERABLE]) {
canCreateStudies: can(authorization: { action: CREATE }) {
value
}
}
}
}
}
}```
解决方案
推荐阅读
- fortran - 让 Doxygen 源代码浏览工作在同名工作区中
- ansible - 是否有指向私钥文件的变量?
- entity-framework - 如果不存在则插入的最佳方法是什么,否则在实体框架核心中更新?
- node.js - 我需要从反应中获取表单数据,并将其发布到我的服务器以用作我的查询变量。我究竟做错了什么?
- c# - 子声明缺少带有 Mongo DB 的 Identity Server 4
- python - 如何在 python 中存根 S3Transfer
- r - R:逐行加速大型矩阵的 na.approx
- c++ - 为什么我不能使用 labmda 作为非类型模板参数?
- java - Java中所有字符大写并在每个字符之间添加空格的递归方法
- reactjs - 仍然没有解决 reactjs sass 安装过程