You are here

protected function EntityQueryEntities::resolveFromRevisionIds in GraphQL 8.3

Resolves entity revisions.

Parameters

string $type: The entity type.

array $ids: The entity revision ids to load.

mixed $metadata: The query context.

array $args: The field arguments array.

\Drupal\graphql\GraphQL\Execution\ResolveContext $context: The resolve context.

\GraphQL\Type\Definition\ResolveInfo $info: The resolve info object.

Return value

\Generator The resolved revisions.

1 call to EntityQueryEntities::resolveFromRevisionIds()
EntityQueryEntities::resolveValues in modules/graphql_core/src/Plugin/GraphQL/Fields/EntityQuery/EntityQueryEntities.php
Retrieve the list of field values.

File

modules/graphql_core/src/Plugin/GraphQL/Fields/EntityQuery/EntityQueryEntities.php, line 173

Class

EntityQueryEntities
Retrieve the entity result set of an entity query.

Namespace

Drupal\graphql_core\Plugin\GraphQL\Fields\EntityQuery

Code

protected function resolveFromRevisionIds($type, $ids, $metadata, array $args, ResolveContext $context, ResolveInfo $info) {
  $storage = $this->entityTypeManager
    ->getStorage($type);
  $entities = array_map(function ($id) use ($storage) {
    return $storage
      ->loadRevision($id);
  }, $ids);
  return $this
    ->resolveEntities($entities, $metadata, $args, $context, $info);
}