class OperationEvent in GraphQL 8.4
Represents an event that is triggered before and after a GraphQL operation.
Hierarchy
- class \Drupal\graphql\Event\OperationEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of OperationEvent
2 files declare their use of OperationEvent
- Executor.php in src/
GraphQL/ Execution/ Executor.php - OperationSubscriber.php in src/
EventSubscriber/ OperationSubscriber.php
File
- src/
Event/ OperationEvent.php, line 12
Namespace
Drupal\graphql\EventView source
class OperationEvent extends Event {
/**
* Event fired before an operation is executed.
*
* @var string
*/
const GRAPHQL_OPERATION_BEFORE = 'graphql.operation.before';
/**
* Event fired after an operation was executed.
*
* @var string
*/
const GRAPHQL_OPERATION_AFTER = 'graphql.operation.after';
/**
* Result of the query execution.
*
* @var \GraphQL\Executor\ExecutionResult
*/
protected $result;
/**
* Resolver context used for the query.
*
* @var \Drupal\graphql\GraphQL\Execution\ResolveContext
*/
protected $context;
/**
* OperationEvent constructor.
*
* @param \Drupal\graphql\GraphQL\Execution\ResolveContext $context
* @param \GraphQL\Executor\ExecutionResult $result
*/
public function __construct(ResolveContext $context, ExecutionResult $result = NULL) {
$this->context = $context;
$this->result = $result;
}
/**
* Returns the execution result.
*
* @return \GraphQL\Executor\ExecutionResult
*/
public function getResult() {
return $this->result;
}
/**
* Returns the resolver context.
*
* @return \Drupal\graphql\GraphQL\Execution\ResolveContext
*/
public function getContext() {
return $this->context;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OperationEvent:: |
protected | property | Resolver context used for the query. | |
OperationEvent:: |
protected | property | Result of the query execution. | |
OperationEvent:: |
public | function | Returns the resolver context. | |
OperationEvent:: |
public | function | Returns the execution result. | |
OperationEvent:: |
constant | Event fired after an operation was executed. | ||
OperationEvent:: |
constant | Event fired before an operation is executed. | ||
OperationEvent:: |
public | function | OperationEvent constructor. |