44
55namespace Graphpinator \PersistedQueries \Bench ;
66
7- class BenchType extends \Graphpinator \Typesystem \Type
7+ use Graphpinator \PersistedQueries \Tests \VariableTest ;
8+ use Graphpinator \Typesystem \Argument \Argument ;
9+ use Graphpinator \Typesystem \Argument \ArgumentSet ;
10+ use Graphpinator \Typesystem \Container ;
11+ use Graphpinator \Typesystem \Field \ResolvableField ;
12+ use Graphpinator \Typesystem \Field \ResolvableFieldSet ;
13+ use Graphpinator \Typesystem \Type ;
14+
15+ class BenchType extends Type
816{
917 protected const NAME = 'type ' ;
1018
@@ -13,83 +21,83 @@ public function validateNonNullValue(mixed $rawValue) : bool
1321 return true ;
1422 }
1523
16- protected function getFieldDefinition () : \ Graphpinator \ Typesystem \ Field \ ResolvableFieldSet
24+ protected function getFieldDefinition () : ResolvableFieldSet
1725 {
18- return new \ Graphpinator \ Typesystem \ Field \ ResolvableFieldSet ([
19- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
26+ return new ResolvableFieldSet ([
27+ ResolvableField::create (
2028 'fieldArg ' ,
21- \ Graphpinator \ Typesystem \ Container::Int ()->notNull (),
29+ Container::Int ()->notNull (),
2230 static function (int $ parent , int $ arg1 ) : int {
2331 return 1 ;
2432 },
25- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
26- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg1 ' , \ Graphpinator \ Typesystem \ Container::Int ())
33+ )->setArguments (new ArgumentSet ([
34+ Argument::create ('arg1 ' , Container::Int ())
2735 ->setDefaultValue (123 ),
2836 ])),
29- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
37+ ResolvableField::create (
3038 'fieldArg1 ' ,
31- \ Graphpinator \ Typesystem \ Container::Int ()->notNull (),
39+ Container::Int ()->notNull (),
3240 static function (int $ parent , ?int $ arg1 = null ) : int {
3341 return 1 ;
3442 },
35- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
36- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg1 ' , \ Graphpinator \ Typesystem \ Container::Int ())
43+ )->setArguments (new ArgumentSet ([
44+ Argument::create ('arg1 ' , Container::Int ())
3745 ->setDefaultValue (null ),
3846 ])),
39- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
47+ ResolvableField::create (
4048 'fieldArg2 ' ,
41- \ Graphpinator \ Typesystem \ Container::Int ()->notNull (),
49+ Container::Int ()->notNull (),
4250 static function (int $ parent , ?array $ arg1 = null ) : int {
4351 return $ arg1 [0 ];
4452 },
45- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
46- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg1 ' , \ Graphpinator \ Typesystem \ Container::Int ()->list ())
53+ )->setArguments (new ArgumentSet ([
54+ Argument::create ('arg1 ' , Container::Int ()->list ())
4755 ->setDefaultValue (null ),
4856 ])),
49- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
57+ ResolvableField::create (
5058 'fieldArg3 ' ,
51- \ Graphpinator \ PersistedQueries \ Tests \ VariableTest::getSimpleEnum ()->notNull (),
59+ VariableTest::getSimpleEnum ()->notNull (),
5260 static function ($ parent , string $ val ) : string {
5361 return $ val ;
5462 },
55- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
56- new \ Graphpinator \ Typesystem \ Argument \ Argument (
63+ )->setArguments (new ArgumentSet ([
64+ new Argument (
5765 'val ' ,
58- \ Graphpinator \ PersistedQueries \ Tests \ VariableTest::getSimpleEnum ()->notNull (),
66+ VariableTest::getSimpleEnum ()->notNull (),
5967 ),
6068 ])),
61- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
69+ ResolvableField::create (
6270 'fieldArg4 ' ,
63- \ Graphpinator \ Typesystem \ Container::Int ()->notNull (),
71+ Container::Int ()->notNull (),
6472 static function ($ parent , \stdClass $ val ) : int {
6573 return $ val ->number ;
6674 },
67- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
68- new \ Graphpinator \ Typesystem \ Argument \ Argument (
75+ )->setArguments (new ArgumentSet ([
76+ new Argument (
6977 'val ' ,
70- \ Graphpinator \ PersistedQueries \ Tests \ VariableTest::getSimpleInput ()->notNull (),
78+ VariableTest::getSimpleInput ()->notNull (),
7179 ),
7280 ])),
73- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
81+ ResolvableField::create (
7482 'fieldArg5 ' ,
75- \ Graphpinator \ Typesystem \ Container::String ()->notNull (),
83+ Container::String ()->notNull (),
7684 static function (int $ parent , string $ arg1 ) : string {
7785 return $ arg1 ;
7886 },
79- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
80- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg1 ' , \ Graphpinator \ Typesystem \ Container::String ()->notNull ())
87+ )->setArguments (new ArgumentSet ([
88+ Argument::create ('arg1 ' , Container::String ()->notNull ())
8189 ->setDefaultValue ('abc ' ),
8290 ])),
83- \ Graphpinator \ Typesystem \ Field \ ResolvableField::create (
91+ ResolvableField::create (
8492 'fieldArg6 ' ,
85- \ Graphpinator \ Typesystem \ Container::String ()->notNull (),
93+ Container::String ()->notNull (),
8694 static function (int $ parent , ?string $ arg1 , ?int $ arg2 , ?bool $ arg3 ) : string {
8795 return 'abc ' ;
8896 },
89- )->setArguments (new \ Graphpinator \ Typesystem \ Argument \ ArgumentSet ([
90- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg1 ' , \ Graphpinator \ Typesystem \ Container::String ()),
91- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg2 ' , \ Graphpinator \ Typesystem \ Container::Int ()),
92- \ Graphpinator \ Typesystem \ Argument \Argument ::create ('arg3 ' , \ Graphpinator \ Typesystem \ Container::Boolean ()),
97+ )->setArguments (new ArgumentSet ([
98+ Argument::create ('arg1 ' , Container::String ()),
99+ Argument::create ('arg2 ' , Container::Int ()),
100+ Argument::create ('arg3 ' , Container::Boolean ()),
93101 ])),
94102 ]);
95103 }
0 commit comments