Skip to content

Commit a2ef916

Browse files
authored
Fix entity revision interface. (#685)
1 parent 7a472e1 commit a2ef916

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

modules/graphql_core/src/Plugin/Deriver/EntityTypeDeriverBase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,22 @@ protected function getInterfaces(EntityTypeInterface $type, array $basePluginDef
6666
$pairs = [
6767
'\Drupal\Core\Entity\EntityDescriptionInterface' => 'EntityDescribable',
6868
'\Drupal\Core\Entity\EntityPublishedInterface' => 'EntityPublishable',
69-
'\Drupal\Core\Entity\RevisionableInterface' => 'EntityRevisionable',
7069
'\Drupal\user\EntityOwnerInterface' => 'EntityOwnable',
7170
];
7271

7372
$interfaces = isset($basePluginDefinition['interfaces']) ? $basePluginDefinition['interfaces'] : [];
73+
$interfaces[] = 'Entity';
74+
7475
foreach ($pairs as $dependency => $interface) {
7576
if ($type->entityClassImplements($dependency)) {
7677
$interfaces[] = $interface;
7778
}
7879
}
7980

81+
if ($type->isRevisionable()) {
82+
$interfaces[] = 'EntityRevisionable';
83+
}
84+
8085
return array_unique($interfaces);
8186
}
8287

modules/graphql_core/src/Plugin/GraphQL/Fields/Entity/EntityRevisions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Drupal\Core\Entity\EntityInterface;
66
use Drupal\graphql\GraphQL\Execution\ResolveContext;
77
use Drupal\graphql_core\Plugin\GraphQL\Fields\EntityQuery\EntityQuery;
8+
use Drupal\graphql_core\Plugin\GraphQL\Interfaces\Entity\EntityRevisionable;
89
use GraphQL\Type\Definition\ResolveInfo;
910

1011
/**

0 commit comments

Comments
 (0)