File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
lib/internal/Magento/Framework/GraphQl/Query Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 14
14
*/
15
15
class IntrospectionConfiguration
16
16
{
17
- const CONFIG_PATH_DISABLE_INTROSPECTION = 'graphql/disable_introspection ' ;
17
+ private const CONFIG_PATH_DISABLE_INTROSPECTION = 'graphql/disable_introspection ' ;
18
18
19
19
/**
20
20
* @var DeploymentConfig
@@ -35,7 +35,7 @@ public function __construct(
35
35
*
36
36
* @return int
37
37
*/
38
- public function disableIntrospection (): int
38
+ public function isIntrospectionDisabled (): int
39
39
{
40
40
return (int ) $ this ->deploymentConfig ->get (self ::CONFIG_PATH_DISABLE_INTROSPECTION );
41
41
}
Original file line number Diff line number Diff line change 11
11
use GraphQL \Validator \Rules \DisableIntrospection ;
12
12
use GraphQL \Validator \Rules \QueryDepth ;
13
13
use GraphQL \Validator \Rules \QueryComplexity ;
14
- use Magento \Framework \App \ObjectManager ;
15
14
16
15
/**
17
16
* QueryComplexityLimiter
@@ -47,12 +46,11 @@ class QueryComplexityLimiter
47
46
public function __construct (
48
47
int $ queryDepth ,
49
48
int $ queryComplexity ,
50
- IntrospectionConfiguration $ introspectionConfig = null
49
+ IntrospectionConfiguration $ introspectionConfig
51
50
) {
52
51
$ this ->queryDepth = $ queryDepth ;
53
52
$ this ->queryComplexity = $ queryComplexity ;
54
- $ this ->introspectionConfig = $ introspectionConfig ?? ObjectManager::getInstance ()
55
- ->get (IntrospectionConfiguration::class);
53
+ $ this ->introspectionConfig = $ introspectionConfig ;
56
54
}
57
55
58
56
/**
@@ -63,7 +61,7 @@ public function __construct(
63
61
public function execute (): void
64
62
{
65
63
DocumentValidator::addRule (new QueryComplexity ($ this ->queryComplexity ));
66
- DocumentValidator::addRule (new DisableIntrospection ($ this ->introspectionConfig ->disableIntrospection ()));
64
+ DocumentValidator::addRule (new DisableIntrospection ($ this ->introspectionConfig ->isIntrospectionDisabled ()));
67
65
DocumentValidator::addRule (new QueryDepth ($ this ->queryDepth ));
68
66
}
69
67
}
You can’t perform that action at this time.
0 commit comments