fix: fix graphiql

This commit is contained in:
Wyatt Johnson
2018-10-12 15:04:45 -06:00
parent d25862e035
commit 5362a26976
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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);
}