Skip to content

Commit

Permalink
Merge pull request #173 from mcg-web/allows-envvar-for-security-query…
Browse files Browse the repository at this point in the history
…-sections

Allows env vars for security query sections
  • Loading branch information
mcg-web committed Aug 16, 2017
2 parents cb34749 + 5939acd commit 3da337e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ private function addSecurityQuerySection($name, $disabledValue)
{
$builder = new TreeBuilder();
$node = $builder->root($name, 'integer');
$node->beforeNormalization()
->ifTrue(function ($v) {
return is_string($v) && is_numeric($v);
})
->then(function ($v) {
return intval($v);
})
->end();

$node
->info('Disabled if equal to false.')
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/app/config/queryComplexity/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:

overblog_graphql:
security:
query_max_complexity: 10
query_max_complexity: '10'
definitions:
schema:
query: Query
Expand Down

0 comments on commit 3da337e

Please sign in to comment.