mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Fixed parseValue
of StringType and IDType: (it should return null on invalid value, not throw)
This commit is contained in:
parent
2023b427ae
commit
5f5c8118c0
@ -55,9 +55,6 @@ When expected as an input type, any string (such as `"4"`) or integer
|
||||
*/
|
||||
public function parseValue($value)
|
||||
{
|
||||
if (!is_scalar($value)) {
|
||||
throw new Error("ID type cannot represent non scalar value: " . Utils::printSafeJson($value));
|
||||
}
|
||||
return (is_string($value) || is_int($value)) ? (string) $value : null;
|
||||
}
|
||||
|
||||
|
@ -52,9 +52,6 @@ represent free-form human-readable text.';
|
||||
*/
|
||||
public function parseValue($value)
|
||||
{
|
||||
if (!is_scalar($value)) {
|
||||
throw new Error("String cannot represent non scalar value: " . Utils::printSafe($value));
|
||||
}
|
||||
return is_string($value) ? $value : null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user