public function create(string $className, string $typeName): Type
    {
        $typeName = Utils::getTypeName($className);
        $description = $this->getDescription($className);

        $fieldsGetter = function () use ($className): array {
            $factory = new OutputFieldsConfigurationFactory($this->types, $this->entityManager);
            $configuration = $factory->create($className);

            return $configuration;
        };

        return new ObjectType([
            'name' => $typeName,
            'description' => $description,
            'fields' => $fieldsGetter,
        ]);
    }
public function create(string $className, string $typeName): Type
    {
        $typeName = Utils::getTypeName($className);
        $description = $this->getDescription($className);

        $fieldsGetter = function () use ($className): array {
            $factory = new OutputFieldsConfigurationFactory($this->types, $this->entityManager);
            $configuration = $factory->create($className);

            return $configuration;
        };

        return new ObjectType([
            'name' => $typeName,
            'description' => $description,
            'fields' => $fieldsGetter,
        ]);
    }
public function create ( string $ className , string $ typeName ) : Type { $ typeName = Utils :: getTypeName ( $ className ) ; $ description = $ this -> getDescription ( $ className ) ; $ fieldsGetter = function ( ) use ( $ className ) : array { $ factory = new OutputFieldsConfigurationFactory ( $ this -> types , $ this -> entityManager ) ; $ configuration = $ factory -> create ( $ className ) ; return $ configuration ; } ; return new ObjectType ( [ 'name' => $ typeName , 'description' => $ description , 'fields' => $ fieldsGetter , ] ) ; }
Create an ObjectType from a Doctrine entity

@param string $className class name of Doctrine entity
@param string $typeName GraphQL type name

@return ObjectType
Create an ObjectType from a Doctrine entity