Only apply max depth and complexity in production to allow introspection

This commit is contained in:
Jake Barnby
2022-09-29 17:46:01 +13:00
parent a3b75a374b
commit 471f12b8ba
+2 -2
View File
@@ -131,11 +131,11 @@ function executeRequest(
$flags = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE;
$validations = GraphQL::getStandardValidationRules();
$validations[] = new QueryComplexity($maxComplexity);
$validations[] = new QueryDepth($maxDepth);
if (App::isProduction()) {
$validations[] = new DisableIntrospection();
$validations[] = new QueryComplexity($maxComplexity);
$validations[] = new QueryDepth($maxDepth);
$flags = DebugFlag::NONE;
}