Skip to content

Commit 9a80b8c

Browse files
committed
closes #147
1 parent 23fbf30 commit 9a80b8c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Diff for: Tests/Schema/VariablesTest.php

+17-1
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,27 @@ public function testInvalidNullableList()
3737
$processor->processPayload(
3838
'query getList($ids: [ID!]) { list(ids: $ids) }',
3939
[
40-
'ids' => [1, 12, null]
40+
'ids' => [1, 12]
4141
]
4242
);
4343
$this->assertEquals(['data' => ['list' => 'item']], $processor->getResponseData());
4444

45+
$processor->getExecutionContext()->clearErrors();
46+
$processor->processPayload(
47+
'query getList($ids: [ID!]) { list(ids: $ids) }',
48+
[
49+
'ids' => [1, 12, null]
50+
]
51+
);
52+
$this->assertEquals(['data' => ['list' => null], 'errors' => [
53+
[
54+
'message' => 'Not valid type for argument "ids" in query "list"',
55+
'locations' => [
56+
['line' => 1, 'column' => 35]
57+
]
58+
],
59+
]], $processor->getResponseData());
60+
4561
$processor->getExecutionContext()->clearErrors();
4662
$processor->processPayload(
4763
'query getList($ids: [ID]) { list(ids: $ids) }',

Diff for: src/Validator/ResolveValidator/ResolveValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function assertValidArguments(FieldInterface $field, AstFieldInterface $q
5050
case TypeMap::KIND_SCALAR:
5151
case TypeMap::KIND_INPUT_OBJECT:
5252
case TypeMap::KIND_LIST:
53-
if (!$argument->getType()->isValidValue($argumentType->parseValue($astArgument->getValue()))) {
53+
if (!$argument->getType()->isValidValue($astArgument->getValue())) {
5454
$error = $argument->getType()->getLastError();
5555
throw new ResolveException($error ? $error : sprintf('Not valid type for argument "%s" in query "%s"', $astArgument->getName(), $field->getName()), $astArgument->getLocation());
5656
}

0 commit comments

Comments
 (0)