Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Plugin/GraphQL/DataProducer/Routing/RouteEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,15 @@ public function __construct(
*/
public function resolve($url, ?string $language, FieldContext $context): ?Deferred {
if ($url instanceof Url) {
// Check that this route is actually an entity route.
if (strpos($url->getRouteName(), 'entity.') === FALSE) {
return NULL;
}
[, $type] = explode('.', $url->getRouteName());
// Make sure that entity type is not empty.
if (empty($type)) {
return NULL;
}
$parameters = $url->getRouteParameters();
$id = $parameters[$type];
$resolver = $this->entityBuffer->add($type, $id);
Expand Down