File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -189,21 +189,23 @@ public function process(ContainerBuilder $container): void
189189 if ($ container ->getParameter ('graphqlite.security.introspection ' ) === false ) {
190190 $ rulesDefinition [] = $ container ->findDefinition (DisableIntrospection::class);
191191 }
192- if ($ container ->hasParameter ('graphqlite.security.maximum_query_complexity ' )) {
193- $ complexity = $ container ->getParameter ('graphqlite.security.maximum_query_complexity ' );
192+
193+ $ complexity = $ container ->getParameter ('graphqlite.security.maximum_query_complexity ' );
194+ if ($ complexity ) {
194195 Assert::integerish ($ complexity );
195196
196197 $ rulesDefinition [] = $ container ->findDefinition (QueryComplexity::class)
197198 ->setArgument (0 , (int ) $ complexity );
198199 }
199200
200- if ( $ container ->hasParameter ('graphqlite.security.maximum_query_depth ' )) {
201- $ depth = $ container -> getParameter ( ' graphqlite.security.maximum_query_depth ' );
201+ $ depth = $ container ->getParameter ('graphqlite.security.maximum_query_depth ' );
202+ if ( $ depth) {
202203 Assert::integerish ($ depth );
203204
204205 $ rulesDefinition [] = $ container ->findDefinition (QueryDepth::class)
205206 ->setArgument (0 , (int ) $ depth );
206207 }
208+
207209 $ serverConfigDefinition ->addMethodCall ('setValidationRules ' , [$ rulesDefinition ]);
208210
209211 if ($ disableMe === false ) {
You can’t perform that action at this time.
0 commit comments