我的angular应用配置了graphql,graphql在playground中默认开启,如何关闭graphql?下面是我的package.json
"dependencies": {
"@nestjs/common": "^7.0.8",
"@nestjs/core": "^7.0.8",
"@nestjs/graphql": "^7.3.4",
"@nestjs/microservices": "^7.0.8",
"class-transformer": "^0.2.3",
"class-validator": "^0.12.2",
"graphql": "^14.0.0",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0"
}
字符串
Dockerfile**
FROM node:16
RUN mkdir -p /testappservice/app
COPY dist/apps/testappservice-container testappservice/app
COPY apps/testappservice/build/docker/package.json testappservice
WORKDIR /testappservice
RUN yarn install
ENV PORT 80
ENV NODE_TLS_REJECT_UNAUTHORIZED 0
ENV NODE_ENV=production
CMD ["node", "app/index.js"]
型
添加了app模块,将playground设置为false,但它仍处于启用状态app.module.ts
@Module({
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
playground:false,
typePaths: ['./**/*.graphql'],
definitions: {
path: join(process.cwd(), './apps/testappservice/src/graphql.schema.ts'),
},
dataSources: () => {
return {
xyzAPI: new XYZAPI(),
abcAPI: new ABCAPI(),
};
},
context: ({ req }) => ({ req }),
}),
ABCModule,
XYZModule,
],
controllers: [],
providers: [],
})
export class AppModule {}
型
1条答案
按热度按时间kmb7vmvb1#
在
GraphQlModule
的选项中,设置playground: false
。app.module.ts
个字符串