Skip to content

Commit ed0c1e5

Browse files
committed
Fix "pages" field.
1 parent 33e8753 commit ed0c1e5

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

src/Field/Pages/PagesCountField.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22

33
namespace ProcessWire\GraphQL\Field\Pages;
44

5-
use Youshido\GraphQL\Execution\ResolveInfo;
6-
use ProcessWire\GraphQL\Field\WireArray\WireArrayCountField;
5+
use Youshido\GraphQL\Type\Scalar\IntType;
6+
use Youshido\GraphQL\Field\AbstractField;
7+
use ProcessWire\GraphQL\Field\Traits\OptionalSelectorTrait;
78

8-
class PagesCountField extends WireArrayCountfield {
9+
class PagesCountField extends AbstractField {
10+
11+
use OptionalSelectorTrait;
12+
13+
public function getType()
14+
{
15+
return new IntType();
16+
}
17+
18+
public function getName()
19+
{
20+
return 'count';
21+
}
922

1023
public function getDescription()
1124
{

src/Field/Pages/PagesFindField.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@
22

33
namespace ProcessWire\GraphQL\Field\Pages;
44

5-
use ProcessWire\GraphQL\Field\PageArray\PageArrayFindField;
5+
use Youshido\GraphQL\Field\AbstractField;
6+
use ProcessWire\GraphQL\Type\Object\PageArrayType;
7+
use ProcessWire\GraphQL\Field\Traits\OptionalSelectorTrait;
68

7-
class PagesFindField extends PageArrayFindField {
9+
class PagesFindField extends AbstractField {
10+
11+
use OptionalSelectorTrait;
12+
13+
public function getType()
14+
{
15+
return new PageArrayType();
16+
}
17+
18+
public function getName()
19+
{
20+
return 'find';
21+
}
822

923
public function getDescription()
1024
{

src/Type/Object/PagesType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function getDescription()
2121

2222
public function build($config)
2323
{
24+
parent::build($config);
2425
$config->addField(new PagesCountField());
2526
$config->addField(new PagesFindField());
2627
}

0 commit comments

Comments
 (0)