| Conditions | 2 |
| Paths | 2 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function __construct(QueryProviderInterface $queryProvider, Registry $registry, SchemaConfig $config = null) |
||
| 18 | { |
||
| 19 | if ($config === null) { |
||
| 20 | $config = SchemaConfig::create(); |
||
| 21 | } |
||
| 22 | |||
| 23 | $query = new ObjectType([ |
||
| 24 | 'name' => 'Query', |
||
| 25 | 'fields' => function() use ($queryProvider) { |
||
| 26 | return $queryProvider->getQueries(); |
||
| 27 | } |
||
| 28 | ]); |
||
| 29 | $mutation = new ObjectType([ |
||
| 30 | 'name' => 'Mutation', |
||
| 31 | 'fields' => function() use ($queryProvider) { |
||
| 32 | return $queryProvider->getMutations(); |
||
| 33 | } |
||
| 34 | ]); |
||
| 35 | |||
| 36 | $config->setQuery($query); |
||
| 37 | $config->setMutation($mutation); |
||
| 38 | $config->setTypeLoader(function(string $name) use ($registry) { |
||
| 39 | return $registry->get($name); |
||
| 40 | }); |
||
| 41 | |||
| 42 | parent::__construct($config); |
||
| 43 | } |
||
| 45 |