File tree Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace ProcessWire \GraphQL \Field \Pages ;
4
4
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 ;
7
8
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
+ }
9
22
10
23
public function getDescription ()
11
24
{
Original file line number Diff line number Diff line change 2
2
3
3
namespace ProcessWire \GraphQL \Field \Pages ;
4
4
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 ;
6
8
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
+ }
8
22
9
23
public function getDescription ()
10
24
{
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public function getDescription()
21
21
22
22
public function build ($ config )
23
23
{
24
+ parent ::build ($ config );
24
25
$ config ->addField (new PagesCountField ());
25
26
$ config ->addField (new PagesFindField ());
26
27
}
You can’t perform that action at this time.
0 commit comments