首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在查询中遇到子选择,但存储区没有对象引用.角度

在查询中遇到子选择,但存储区没有对象引用.角度
EN

Stack Overflow用户
提问于 2022-05-06 22:37:06
回答 1查看 51关注 0票数 2

当我尝试进行一些gql查询时,我会得到这个错误:

我已经尝试更改了角版本,但是我需要在这个版本中实现gql。不升级:/

package.json

代码语言:javascript
复制
{
  "dependencies": {
    "@angular/cdk": "^5.2.5",
    "@angular/common": "^5.2.10",
    "@angular/compiler": "^5.2.10",
    "@angular/core": "^5.2.10",
    ...
    "rxjs": "^5.5.9",
    "zone.js": "^0.8.26",
    "apollo-angular": "^1.0.1",
    "apollo-angular-link-http": "^1.0.2-beta.0",
    "apollo-cache-inmemory": "^1.1.5",
    "apollo-client": "^2.2.0",
    "graphql": "^0.12.3",
    "graphql-tag": "^2.6.1"
  },
  "devDependencies": {
    "@angular/cli": "^1.7.4",
    "@angular/compiler-cli": "^5.2.10",
    "@types/node": "^9.6.6",
    "ts-node": "^4.1.0",
    "tslint": "^5.9.1",
    "typescript": "^2.8.3"
  }
}

app.module.ts

代码语言:javascript
复制
...
import { ApolloModule, Apollo } from 'apollo-angular';
import { HttpLinkModule, HttpLink  } from 'apollo-angular-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';

@NgModule({
  imports: [
    ...
    HttpClientModule,
    ApolloModule,
    HttpLinkModule
  ],
..
})
export class AppModule {

  constructor(
    apollo: Apollo,
    httpLink: HttpLink
  ) {
    apollo.create({
      link: httpLink.create({ uri: 'https://graphqlzero.almansi.me/api'}),
      cache: new InMemoryCache()
    });
  }
}

我怎么才能解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-07 09:04:36

我通过将apollo-cache-inmemory1.1.5升级到1.3.0来解决这个问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72148024

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档