schemaFactory = $schemaFactory; $this->config = $config; $this->typeRegistry = $typeRegistry; } /** * @inheritdoc */ public function generate() : Schema { $schema = $this->schemaFactory->create( [ 'query' => $this->typeRegistry->get('Query'), 'mutation' => $this->typeRegistry->get('Mutation'), 'typeLoader' => function ($name) { return $this->typeRegistry->get($name); }, 'types' => function () { $typesImplementors = []; foreach ($this->config->getDeclaredTypes() as $type) { $typesImplementors [] = $this->typeRegistry->get($type['name']); } return $typesImplementors; } ] ); return $schema; } }