@nestjs/graphql访问操场



我将@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,

在我的app模块我有:

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

最后是我的包裹。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仍然可以工作。

最新更新