首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >@nestjs/graphql访问操场

@nestjs/graphql访问操场
EN

Stack Overflow用户
提问于 2021-08-31 14:16:03
回答 1查看 949关注 0票数 0

我将@nest/graphql的版本从7.9.11更新到7.11.0,现在我有了以下错误:

代码语言:javascript
运行
复制
src/app.module.ts:26:7 - error TS2345: Argument of type '{ path: string; autoSchemaFile: string; sortSchema: true; playground: boolean; }' is not assignable to parameter of type 'GqlModuleOptions'.
  Object literal may only specify known properties, and 'playground' does not exist in type 'GqlModuleOptions'.

26       playground: true,

在我的应用模块中我有:

代码语言:javascript
运行
复制
 GraphQLModule.forRoot({
      path: 'api/graphql',
      autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
      sortSchema: true,
      playground: true,
    }),

最后,我的package.json看起来如下:

代码语言:javascript
运行
复制
"dependencies": {
    "@instana/collector": "1.126.2",
    "@nestjs/common": "7.6.18",
    "@nestjs/config": "0.6.3",
    "@nestjs/core": "7.6.18",
    "@nestjs/graphql": "7.11.0",
    "@nestjs/passport": "7.1.5",
    "@nestjs/platform-express": "7.6.18",
    "@nestjs/terminus": "7.2.0",
    "@nestjs/typeorm": "7.1.5",
    "apollo-server-express": "2.25.2",
    "cache-manager": "3.4.4",
    "cache-manager-redis-store": "2.0.0",
    "date-fns": "2.22.1",
    "graphql": "15.5.1",
    "graphql-tools": "7.0.5",
    "jwks-rsa": "1.12.3",
    "nestjs-pino": "1.4.0",
    "nestjs-redis": "1.3.3",
    "passport": "0.4.1",
    "passport-jwt": "4.0.0",
    "pg": "8.6.0",
    "pino-pretty": "5.1.0",
    "reflect-metadata": "0.1.13",
    "rimraf": "3.0.2",
    "rxjs": "6.6.7",
    "typeorm": "0.2.34"
  },
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-28 13:05:35

正如@ghiscoding在其评论中所说,游乐场选项在新版本中不存在,但是操场没有它仍然工作。

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

https://stackoverflow.com/questions/69000341

复制
相关文章

相似问题

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