1
0
Fork 0
mirror of synced 2024-06-28 19:20:25 +12:00

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
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

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;
}