diff --git a/Tests/Schema/VariablesTest.php b/Tests/Schema/VariablesTest.php index 334fe4e6..53e2b016 100644 --- a/Tests/Schema/VariablesTest.php +++ b/Tests/Schema/VariablesTest.php @@ -37,11 +37,27 @@ public function testInvalidNullableList() $processor->processPayload( 'query getList($ids: [ID!]) { list(ids: $ids) }', [ - 'ids' => [1, 12, null] + 'ids' => [1, 12] ] ); $this->assertEquals(['data' => ['list' => 'item']], $processor->getResponseData()); + $processor->getExecutionContext()->clearErrors(); + $processor->processPayload( + 'query getList($ids: [ID!]) { list(ids: $ids) }', + [ + 'ids' => [1, 12, null] + ] + ); + $this->assertEquals(['data' => ['list' => null], 'errors' => [ + [ + 'message' => 'Not valid type for argument "ids" in query "list"', + 'locations' => [ + ['line' => 1, 'column' => 35] + ] + ], + ]], $processor->getResponseData()); + $processor->getExecutionContext()->clearErrors(); $processor->processPayload( 'query getList($ids: [ID]) { list(ids: $ids) }', diff --git a/src/Validator/ResolveValidator/ResolveValidator.php b/src/Validator/ResolveValidator/ResolveValidator.php index 2759fb6f..a3b30b15 100644 --- a/src/Validator/ResolveValidator/ResolveValidator.php +++ b/src/Validator/ResolveValidator/ResolveValidator.php @@ -50,7 +50,7 @@ public function assertValidArguments(FieldInterface $field, AstFieldInterface $q case TypeMap::KIND_SCALAR: case TypeMap::KIND_INPUT_OBJECT: case TypeMap::KIND_LIST: - if (!$argument->getType()->isValidValue($argumentType->parseValue($astArgument->getValue()))) { + if (!$argument->getType()->isValidValue($astArgument->getValue())) { $error = $argument->getType()->getLastError(); throw new ResolveException($error ? $error : sprintf('Not valid type for argument "%s" in query "%s"', $astArgument->getName(), $field->getName()), $astArgument->getLocation()); }