Code Duplication    Length = 5-5 lines in 3 locations

modules/graphql_core/src/Plugin/GraphQL/Mutations/Entity/UpdateEntityBase.php 3 locations

@@ 55-59 (lines=5) @@
52
    $storage = $this->entityTypeManager->getStorage($entityTypeId);
53
54
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
55
    if (!$entity = $storage->load($args['id'])) {
56
      return new EntityCrudOutputWrapper(NULL, NULL, [
57
        $this->t('The requested @bundle could not be loaded.', ['@bundle' => $bundleName]),
58
      ]);
59
    }
60
61
    if (!$entity->bundle() === $bundleName) {
62
      return new EntityCrudOutputWrapper(NULL, NULL, [
@@ 61-65 (lines=5) @@
58
      ]);
59
    }
60
61
    if (!$entity->bundle() === $bundleName) {
62
      return new EntityCrudOutputWrapper(NULL, NULL, [
63
        $this->t('The requested entity is not of the expected type @bundle.', ['@bundle' => $bundleName]),
64
      ]);
65
    }
66
67
    if (!$entity->access('update')) {
68
      return new EntityCrudOutputWrapper(NULL, NULL, [
@@ 67-71 (lines=5) @@
64
      ]);
65
    }
66
67
    if (!$entity->access('update')) {
68
      return new EntityCrudOutputWrapper(NULL, NULL, [
69
        $this->t('You do not have the necessary permissions to update this @bundle.', ['@bundle' => $bundleName]),
70
      ]);
71
    }
72
73
    // The raw input needs to be converted to use the proper field and property
74
    // keys because we usually convert them to camel case when adding them to