Skip to content

Commit 8caf151

Browse files
committed
Fix numChildren field.
1 parent 81d967c commit 8caf151

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Field/Page/PageNumChildrenField.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ public function build(FieldConfig $config)
3636
$config->addArgument(new InputField([
3737
'name' => self::firstArgumentName,
3838
'type' => new BooleanType(),
39-
'default' => false,
4039
]));
4140
}
4241

4342
public function resolve($value, array $args, ResolveInfo $info)
4443
{
45-
$visible = $args[self::firstArgumentName];
44+
$visible = false;
45+
if (isset($args[self::firstArgumentName])) {
46+
$visible = $args[self::firstArgumentName];
47+
}
4648
if ($visible) return $value->numChildren($visible);
4749
return $value->numChildren;
4850
}

0 commit comments

Comments
 (0)