mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-06 08:50:50 +08:00
feat(server): change the playground option to GraphiQL. (#13451)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * The GraphQL interactive UI is now available only in development environments and will not be accessible in production. This change affects only the availability of the interactive interface; public exports and API context types remain unchanged. Users in development can continue to use the tool as before, while production deployments will no longer expose the interactive UI. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import { Global, Module } from '@nestjs/common';
|
|||||||
import { GraphQLModule } from '@nestjs/graphql';
|
import { GraphQLModule } from '@nestjs/graphql';
|
||||||
import type { Request, Response } from 'express';
|
import type { Request, Response } from 'express';
|
||||||
|
|
||||||
|
import { NodeEnv } from '../../env';
|
||||||
import { Config } from '../config';
|
import { Config } from '../config';
|
||||||
import { mapAnyError } from '../nestjs/exception';
|
import { mapAnyError } from '../nestjs/exception';
|
||||||
import { GQLLoggerPlugin } from './logger-plugin';
|
import { GQLLoggerPlugin } from './logger-plugin';
|
||||||
@@ -30,7 +31,7 @@ export type GraphqlContext = {
|
|||||||
numberScalarMode: 'integer',
|
numberScalarMode: 'integer',
|
||||||
},
|
},
|
||||||
useGlobalPrefix: true,
|
useGlobalPrefix: true,
|
||||||
playground: true,
|
graphiql: env.NODE_ENV === NodeEnv.Development,
|
||||||
sortSchema: true,
|
sortSchema: true,
|
||||||
autoSchemaFile: join(
|
autoSchemaFile: join(
|
||||||
env.projectRoot,
|
env.projectRoot,
|
||||||
|
|||||||
Reference in New Issue
Block a user