Closed
Description
Field with type 'notNull' ignores default value and throws error:
"Argument "paging" has invalid value {pageSize: 2}. In field "page": Expected "Int!", found null."
// PagingType.php
$config = [
'fields' => function () {
return [
'page' => [
'type' => Type::nonNull(Type::int()),
'defaultValue' => 1,
],
'pageSize' => Type::nonNull(Type::int()),
];
},
];
With nullable types default value works as expected but then client can pass null value into page field...
Metadata
Metadata
Assignees
Labels
No labels