tests/Type/ValidatedFieldDefinition/NonNullScalarValidationTest.php 1 location
|
@@ 83-89 (lines=7) @@
|
80 |
|
'bookId' => [ |
81 |
|
'type' => Type::nonNull(Type::id()), |
82 |
|
'errorCodes' => ['bookNotFound'], |
83 |
|
'validate' => function ($bookId) { |
84 |
|
if (isset($this->data['books'][$bookId])) { |
85 |
|
return 0; |
86 |
|
} |
87 |
|
|
88 |
|
return ['bookNotFound', 'Unknown book!']; |
89 |
|
}, |
90 |
|
], |
91 |
|
], |
92 |
|
'resolve' => function ($value, $args) : array { |
tests/Type/ValidatedFieldDefinition/ScalarValidationTest.php 1 location
|
@@ 86-92 (lines=7) @@
|
83 |
|
'bookId' => [ |
84 |
|
'type' => Type::id(), |
85 |
|
'errorCodes' => ['bookNotFound'], |
86 |
|
'validate' => function ($bookId) { |
87 |
|
if (isset($this->data['books'][$bookId])) { |
88 |
|
return 0; |
89 |
|
} |
90 |
|
|
91 |
|
return ['bookNotFound', 'Unknown book!']; |
92 |
|
}, |
93 |
|
], |
94 |
|
], |
95 |
|
'resolve' => static function ($value) : bool { |