@nestjs/graphql 进入游乐场

@nestjs/graphql access to the playground

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

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,

在我的应用程序模块中,我有:

 GraphQLModule.forRoot({
      path: 'api/graphql',
      autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
      sortSchema: true,
      playground: true,
    }),

最后我的 package.json 看起来像这样:

"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"
  },

正如@ghiscoding 在其评论中所说,新版本中不存在 playground 选项,但没有它 playground 仍然可以工作。