Skip to content

Commit ffb15b0

Browse files
committed
Get rid of WireArray & WireData. They do nothing.
1 parent 9226db9 commit ffb15b0

File tree

8 files changed

+33
-146
lines changed

8 files changed

+33
-146
lines changed

src/Field/PageArray/PageArrayFindField.php

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

33
namespace ProcessWire\GraphQL\Field\PageArray;
44

5-
use ProcessWire\GraphQL\Field\WireArray\WireArrayFindField;
5+
use Youshido\GraphQL\Field\AbstractField;
6+
use Youshido\GraphQL\Type\NonNullType;
67
use ProcessWire\GraphQL\Type\Object\PageArrayType;
8+
use ProcessWire\GraphQL\Field\Traits\RequiredSelectorTrait;
79

8-
class PageArrayFindField extends WireArrayFindField {
10+
class PageArrayFindField extends AbstractField {
11+
12+
use RequiredSelectorTrait;
13+
14+
public function getName()
15+
{
16+
return 'find';
17+
}
918

1019
public function getType()
1120
{
12-
return new PageArrayType();
21+
return new NonNullType(new PageArrayType());
1322
}
1423

1524
public function getDescription()

src/Field/PageArray/PageArrayListField.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
namespace ProcessWire\GraphQL\Field\PageArray;
44

55
use Youshido\GraphQL\Type\ListType\ListType;
6-
use ProcessWire\GraphQL\Field\WireArray\WireArrayListField;
6+
use Youshido\GraphQL\Field\AbstractField;
7+
use Youshido\GraphQL\Execution\ResolveInfo;
78
use ProcessWire\GraphQL\Type\InterfaceType\PageInterfaceType;
89

9-
class PageArrayListField extends WireArrayListField {
10+
class PageArrayListField extends AbstractField {
11+
12+
public function getName()
13+
{
14+
return 'list';
15+
}
1016

1117
public function getType()
1218
{
1319
return new ListType(new PageInterfaceType());
1420
}
1521

22+
public function resolve($value, array $args, ResolveInfo $info)
23+
{
24+
return $value;
25+
}
26+
1627
}

src/Field/WireArray/WireArrayCountField.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Field/WireArray/WireArrayFindField.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Field/WireArray/WireArrayListField.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/Type/Object/PageArrayType.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
namespace ProcessWire\GraphQL\Type\Object;
44

5+
use Youshido\GraphQL\Type\Object\AbstractObjectType;
56
use ProcessWire\GraphQL\Type\Object\WireArrayType;
67
use ProcessWire\GraphQL\Field\PageArray\PageArrayListField;
78
use ProcessWire\GraphQL\Field\PageArray\PageArrayFindField;
9+
use ProcessWire\GraphQL\Field\PageArray\PageArrayCountField;
810
use ProcessWire\GraphQL\Type\InterfaceType\PaginatedArrayInterfaceType;
911

10-
class PageArrayType extends WireArrayType {
12+
class PageArrayType extends AbstractObjectType {
1113

1214
public function getName()
1315
{
@@ -21,10 +23,14 @@ public function getDescription()
2123

2224
public function build($config)
2325
{
24-
parent::build($config);
2526
$config->applyInterface(new PaginatedArrayInterfaceType());
2627
$config->addField(new PageArrayListField());
2728
$config->addField(new PageArrayFindField());
2829
}
2930

31+
public function getInterfaces()
32+
{
33+
return [ new PaginatedArrayInterfaceType() ];
34+
}
35+
3036
}

src/Type/Object/WireArrayType.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Type/Object/WireDataType.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)