Skip to content

Commit 61502c9

Browse files
committed
Rollback changes done to the InputValidator and the relevant tests
1 parent cd19c3e commit 61502c9

File tree

4 files changed

+0
-43
lines changed

4 files changed

+0
-43
lines changed

src/Validator/InputValidator.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,6 @@ private function buildValidationTree(ValidationNode $rootObject, iterable $field
140140
$property = $arg['name'] ?? $name;
141141
$config = static::normalizeConfig($arg['validation'] ?? []);
142142

143-
if (!array_key_exists($property, $inputData)) {
144-
// This field was not provided in the inputData. Do not attempt to validate it.
145-
continue;
146-
}
147-
148143
if (isset($config['cascade']) && isset($inputData[$property])) {
149144
$groups = $config['cascade'];
150145
$argType = $this->unclosure($arg['type']);

tests/Functional/App/config/validator/mapping/Mutation.types.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,3 @@ Mutation:
138138
validation:
139139
cascade:
140140
groups: ['group2']
141-
142-
onlyPassedFieldsValidation:
143-
type: Boolean
144-
resolve: '@=m("mutation_mock", args)'
145-
args:
146-
person:
147-
validation: cascade
148-
type: Person!

tests/Functional/App/config/validator/mapping/Person.types.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/Functional/Validator/InputValidatorTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,6 @@ public function testLinkedConstraintsValidationPasses(): void
8787
$this->assertTrue($result['data']['linkedConstraintsValidation']);
8888
}
8989

90-
public function testOnlyPassedFieldsValidated(): void
91-
{
92-
$query = '
93-
mutation {
94-
onlyPassedFieldsValidation(
95-
person: { firstName: "Joe" }
96-
)
97-
}
98-
';
99-
100-
$result = $this->executeGraphQLRequest($query);
101-
102-
$this->assertTrue(empty($result['errors']));
103-
$this->assertTrue($result['data']['onlyPassedFieldsValidation']);
104-
}
105-
10690
public function testLinkedConstraintsValidationFails(): void
10791
{
10892
$query = '

0 commit comments

Comments
 (0)