Skip to content

Commit 5939acd

Browse files
author
Jeremiah VALERIE
committed
Allows env vars for security query sections
1 parent cb34749 commit 5939acd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ private function addSecurityQuerySection($name, $disabledValue)
199199
{
200200
$builder = new TreeBuilder();
201201
$node = $builder->root($name, 'integer');
202+
$node->beforeNormalization()
203+
->ifTrue(function ($v) {
204+
return is_string($v) && is_numeric($v);
205+
})
206+
->then(function ($v) {
207+
return intval($v);
208+
})
209+
->end();
202210

203211
$node
204212
->info('Disabled if equal to false.')

Tests/Functional/app/config/queryComplexity/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77

88
overblog_graphql:
99
security:
10-
query_max_complexity: 10
10+
query_max_complexity: '10'
1111
definitions:
1212
schema:
1313
query: Query

0 commit comments

Comments
 (0)