Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TypeReaderComposite.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 {
16  private $typeReaders = [];
17 
21  public function __construct(
22  $typeReaders = []
23  ) {
24  $this->typeReaders = $typeReaders;
25  }
26 
30  public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
31  {
32  foreach ($this->typeReaders as $typeReader) {
33  $result = $typeReader->read($typeMeta);
34  if (!empty($result)) {
35  return $result;
36  }
37  }
38  return [];
39  }
40 }