GraphQLComposeFieldTypeManager->getBundleFields does not check if bundle exists.

Created on 13 April 2024, 9 months ago

Summary:

- Default site install
- Enable all graphql compose modules
- Visit schema voyager in GraphQL

TypeError: Drupal\graphql_compose\Plugin\GraphQLCompose\GraphQLComposeFieldTypeBase::setEntityWrapper(): Argument #1 ($entity_wrapper) must be of type Drupal\graphql_compose\Wrapper\EntityTypeWrapper, null given, called in C:\wamp64\www\drupal10\web\modules\contrib\graphql_compose\src\Plugin\GraphQLComposeFieldTypeManager.php on line 263 in Drupal\graphql_compose\Plugin\GraphQLCompose\GraphQLComposeFieldTypeBase->setEntityWrapper() (line 115 of modules\contrib\graphql_compose\src\Plugin\GraphQLCompose\GraphQLComposeFieldTypeBase.php).
Drupal\graphql_compose\Plugin\GraphQLComposeFieldTypeManager->getBundleFields('node', 'article') (Line: 129)
Drupal\graphql_compose_comments\Plugin\GraphQLCompose\SchemaType\CommentAvailable->getAllCommentableBundles() (Line: 28)
Drupal\graphql_compose_comments\Plugin\GraphQLCompose\SchemaType\CommentAvailable->getTypes() (Line: 99)
Drupal\graphql_compose\Plugin\GraphQLComposeSchemaTypeManager->createInstance('CommentAvailable') (Line: 154)
Drupal\graphql_compose\Plugin\GraphQLComposeSchemaTypeManager->get('CommentAvailable') (Line: 67)
Drupal\graphql_compose\Controller\FragmentController->show()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

This creates an error because $bundle is null
\graphql_compose\src\Plugin\GraphQLComposeFieldTypeManager.php on line 263

$bundle = $entity_plugin_type->getBundle($bundle_id);
🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇫🇷France lazzyvn paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024