Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/SchemaFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Doctrine\Common\Cache\PhpFileCache;
use GraphQL\Type\SchemaConfig;
use Mouf\Composer\ClassNameMapper;
use MyCLabs\Enum\Enum;
use PackageVersions\Versions;
use Psr\Container\ContainerInterface;
use Psr\SimpleCache\CacheInterface;
Expand Down Expand Up @@ -52,6 +53,7 @@
use TheCodingMachine\GraphQLite\Utils\Namespaces\NamespaceFactory;
use function array_map;
use function array_reverse;
use function class_exists;
use function crc32;
use function function_exists;
use function md5;
Expand Down Expand Up @@ -346,7 +348,9 @@ public function createSchema(): Schema

$errorRootTypeMapper = new FinalRootTypeMapper($recursiveTypeMapper);
$rootTypeMapper = new BaseTypeMapper($errorRootTypeMapper, $recursiveTypeMapper, $topRootTypeMapper);
$rootTypeMapper = new MyCLabsEnumTypeMapper($rootTypeMapper, $annotationReader, $symfonyCache, $nsList);
if (class_exists(Enum::class)) {
$rootTypeMapper = new MyCLabsEnumTypeMapper($rootTypeMapper, $annotationReader, $symfonyCache, $nsList);
}

if (! empty($this->rootTypeMapperFactories)) {
$rootSchemaFactoryContext = new RootTypeMapperFactoryContext(
Expand Down