You are here

public function CurrentUser::__construct in GraphQL 8.4

CurrentUser constructor.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

array $plugin_definition: The plugin implementation definition.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

Overrides ContextAwarePluginBase::__construct

File

src/Plugin/GraphQL/DataProducer/User/CurrentUser.php, line 56

Class

CurrentUser
Gets the current user.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\User

Code

public function __construct(array $configuration, string $plugin_id, array $plugin_definition, AccountInterface $current_user) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->currentUser = $current_user;
}