From 788865e0aeb3f9d864c2b3b33ebb8cd46b96c3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rainer=20M=C3=BCller?= <rainer.muller@keyconsulting.fr> Date: Thu, 13 Feb 2025 12:24:55 +0100 Subject: [PATCH] Revert "Fix error when resolving type for "File"" This reverts commit b0e4011ba440b8e48040c301f9e334b9362467ad. --- src/CoreComposableResolver.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/CoreComposableResolver.php b/src/CoreComposableResolver.php index be4e985..b16ff0a 100644 --- a/src/CoreComposableResolver.php +++ b/src/CoreComposableResolver.php @@ -30,7 +30,6 @@ use Drupal\Core\TypedData\Plugin\DataType\Timestamp; use Drupal\Core\TypedData\Plugin\DataType\Uri; use Drupal\Core\TypedData\TypedDataInterface; use Drupal\Core\Url; -use Drupal\file\FileInterface; use Drupal\file\Plugin\Field\FieldType\FileFieldItemList; use Drupal\graphql\GraphQL\Execution\ResolveContext; use Drupal\graphql\GraphQL\ResolverBuilder; @@ -424,14 +423,7 @@ class CoreComposableResolver { * The default type. */ public static function resolveTypeDefault($value, ResolveContext $context, ResolveInfo $info) { - if ($value instanceof FileInterface) { - // Special handling here because if we return "File" as a string, - // the execution resolver will call "is_callable('File')", which evaluates - // to true. This then ends up calling the PHP file() method without - // any arguments, which will throw an error. - return $info->schema->getType('File'); - } - elseif ($value instanceof EntityInterface) { + if ($value instanceof EntityInterface) { $type = EntitySchemaHelper::getGraphqlTypeForEntity($value); return $type; } -- GitLab