@@ -54,7 +54,7 @@ public function execute(Schema $schema, array $document, $rootValue = null, $con
5454 );
5555
5656 // return early errors if execution context failed.
57- if (is_array ($ executionContext )){
57+ if (is_array ($ executionContext )) {
5858 return [
5959 "errors " => Errors::prettyPrintErrors ($ executionContext ),
6060 "data " => []
@@ -205,7 +205,7 @@ private function doesFragmentConditionMatch(ExecutionContext $executionContext,
205205 private function shouldIncludeNode (ExecutionContext $ executionContext , $ node ): bool
206206 {
207207 // skip check for directives if no directives wanted
208- if (empty ($ node ["directives " ]))
208+ if (empty ($ node ["directives " ]))
209209 return true ;
210210
211211 // check if skip directive is active
@@ -710,6 +710,11 @@ public function buildExecutionContext(Schema $schema, array $document, $rootValu
710710 $ variableDefinitions = $ operation ["variableDefinitions " ] ?? [];
711711 $ coercedVariableValues = Values::getVariableValues ($ schema , $ variableDefinitions , $ rawVariableValues ?? []);
712712
713+ // check if $coercedVariableValues contains only one numeric index because that means
714+ // that the variables' coercing values were not formatted correctly.
715+ if (count ($ coercedVariableValues ) === 1 and array_key_first ($ coercedVariableValues ) === 0 )
716+ return $ coercedVariableValues ;
717+
713718 // default $contextValue to an empty array
714719 $ contextValue = $ contextValue ?? [];
715720
0 commit comments