Conditions | 2 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
29 | protected function build(TypeConfigInterface $config) |
||
30 | { |
||
31 | $config |
||
32 | ->addField('hero', new CharacterInterface(), [ |
||
33 | 'args' => [ |
||
34 | 'episode' => ['type' => new EpisodeEnum()] |
||
35 | ], |
||
36 | 'resolve' => function ($root, $args) { |
||
37 | return StarWarsData::getHero(isset($args['episode']) ? $args['episode'] : null); |
||
38 | }, |
||
39 | ]) |
||
40 | ->addField('human', new HumanType()) |
||
41 | ->addField('droid', new DroidType()); |
||
42 | } |
||
43 | } |