You are here

protected function EntityQuery::getBaseQuery in GraphQL 8.3

Create the basic entity query for the plugin's entity type.

Parameters

mixed $value: The parent entity type.

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

\Drupal\Core\Entity\Query\QueryInterface|null The entity query object.

5 calls to EntityQuery::getBaseQuery()
EntityQuery::getQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/EntityQuery/EntityQuery.php
Create the full entity query for the plugin's entity type.
EntityQueryExclusive::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/Entity/EntityQueryExclusive.php
Create the basic entity query for the plugin's entity type.
EntityReferenceQuery::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/EntityReference/EntityReferenceQuery.php
Create the basic entity query for the plugin's entity type.
EntityReferenceReverse::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/EntityReference/EntityReferenceReverse.php
Create the basic entity query for the plugin's entity type.
EntityRevisions::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/Entity/EntityRevisions.php
Create the basic entity query for the plugin's entity type.
4 methods override EntityQuery::getBaseQuery()
EntityQueryExclusive::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/Entity/EntityQueryExclusive.php
Create the basic entity query for the plugin's entity type.
EntityReferenceQuery::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/EntityReference/EntityReferenceQuery.php
Create the basic entity query for the plugin's entity type.
EntityReferenceReverse::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/EntityReference/EntityReferenceReverse.php
Create the basic entity query for the plugin's entity type.
EntityRevisions::getBaseQuery in modules/graphql_core/src/Plugin/GraphQL/Fields/Entity/EntityRevisions.php
Create the basic entity query for the plugin's entity type.

File

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

Class

EntityQuery
@GraphQLField( id = "entity_query", secure = false, type = "EntityQueryResult", arguments = { "filter" = "EntityQueryFilterInput", "sort" = "[EntityQuerySortInput]", "offset" =…

Namespace

Drupal\graphql_core\Plugin\GraphQL\Fields\EntityQuery

Code

protected function getBaseQuery($value, array $args, ResolveContext $context, ResolveInfo $info) {
  $entityType = $this
    ->getEntityType($value, $args, $context, $info);
  $entityStorage = $this->entityTypeManager
    ->getStorage($entityType);
  $query = $entityStorage
    ->getQuery();
  $query
    ->accessCheck(TRUE);

  // The context object can e.g. transport the parent entity language.
  $query
    ->addMetaData('graphql_context', $this
    ->getQueryContext($value, $args, $context, $info));
  return $query;
}