mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 02:44:32 +08:00
fix: fix graphiql
This commit is contained in:
@@ -64,7 +64,7 @@ export async function createRouter(app: AppOptions, options: RouterOptions) {
|
||||
function attachGraphiQL(router: Router, app: AppOptions) {
|
||||
if (app.config.get("env") === "production") {
|
||||
logger.warn(
|
||||
"enable_graphiql is enabled, but we're in production mode, this is not recommended"
|
||||
"it is not recommended to have enable_graphiql enabled while in production mode as it requires introspection queries to be enabled"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export const graphqlMiddleware = (
|
||||
// Generate the validation rules.
|
||||
const validationRules: Array<(context: ValidationContext) => any> = [];
|
||||
|
||||
if (config.get("env") === "production") {
|
||||
if (config.get("env") === "production" && !config.get("enable_graphiql")) {
|
||||
// Disable introspection in production.
|
||||
validationRules.push(NoIntrospection);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user