diff --git a/src/Plugin/GraphQL/DataProducer/Entity/EntityLabel.php b/src/Plugin/GraphQL/DataProducer/Entity/EntityLabel.php index 7c44ffd20..d80846220 100644 --- a/src/Plugin/GraphQL/DataProducer/Entity/EntityLabel.php +++ b/src/Plugin/GraphQL/DataProducer/Entity/EntityLabel.php @@ -41,13 +41,13 @@ class EntityLabel extends DataProducerPluginBase implements DataProducerPluginCa * Resolver. * * @param \Drupal\Core\Entity\EntityInterface $entity - * @param bool|null $access + * @param bool $access * @param \Drupal\Core\Session\AccountInterface|null $accessUser * @param \Drupal\graphql\GraphQL\Execution\FieldContext $context * * @return string|null */ - public function resolve(EntityInterface $entity, ?bool $access, ?AccountInterface $accessUser, FieldContext $context) { + public function resolve(EntityInterface $entity, bool $access, ?AccountInterface $accessUser, FieldContext $context) { if ($access) { /** @var \Drupal\Core\Access\AccessResultInterface $accessResult */ $accessResult = $entity->access('view label', $accessUser, TRUE); diff --git a/tests/src/Kernel/DataProducer/EntityTest.php b/tests/src/Kernel/DataProducer/EntityTest.php index 69496e60b..c6a0d26e1 100644 --- a/tests/src/Kernel/DataProducer/EntityTest.php +++ b/tests/src/Kernel/DataProducer/EntityTest.php @@ -222,10 +222,14 @@ public function testResolveLabel(): void { $this->assertEquals('Dummy label', $this->executeDataProducer('entity_label', [ 'entity' => $this->entity, + // @todo Remove when https://github.com/drupal-graphql/graphql/issues/1233 is fixed. + 'access' => TRUE, ])); $this->assertNull($this->executeDataProducer('entity_label', [ 'entity' => $this->entity, + // @todo Remove when https://github.com/drupal-graphql/graphql/issues/1233 is fixed. + 'access' => TRUE, ])); }