diff --git a/src/Type/Schema.php b/src/Type/Schema.php index f01184cae..b0332ceaa 100644 --- a/src/Type/Schema.php +++ b/src/Type/Schema.php @@ -99,6 +99,18 @@ public function __construct($config) $this->extensionASTNodes = $config->extensionASTNodes; $this->config = $config; + + $types = $this->config->types; + if (is_callable($types)) { + $types = $types(); + } + foreach ($types as $typeOrLazyType) { + /** @var Type|callable(): Type $typeOrLazyType */ + $type = self::resolveType($typeOrLazyType); + assert($type instanceof NamedType); + $this->resolvedTypes[$type->name()] = $type; + } + // $this->config->types = []; // Don't resolve these again? } /**