You are here

class SubRequestResponse in GraphQL 8.4

Helper class that holds a request result for subrequests.

Hierarchy

Expanded class hierarchy of SubRequestResponse

1 file declares its use of SubRequestResponse
SubrequestExtractionController.php in src/Controller/SubrequestExtractionController.php

File

src/SubRequestResponse.php, line 12

Namespace

Drupal\graphql
View source
class SubRequestResponse extends Response implements RefinableCacheableDependencyInterface {
  use RefinableCacheableDependencyTrait;

  /**
   * The request result.
   *
   * @var mixed
   */
  protected $result;

  /**
   * SubrequestResponse constructor.
   *
   * @param mixed $result
   *   The request result.
   * @param int $status
   *   The response status code.
   * @param array $headers
   *   An array of response headers.
   */
  public function __construct($result, $status = 200, array $headers = []) {
    parent::__construct('', $status, $headers);
    $this->result = $result;
  }

  /**
   * Gets the request result.
   *
   * @return mixed
   *   The request result.
   */
  public function getResult() {
    return $this->result;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 3
CacheableDependencyTrait::getCacheMaxAge public function 3
CacheableDependencyTrait::getCacheTags public function 3
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
SubRequestResponse::$result protected property The request result.
SubRequestResponse::getResult public function Gets the request result.
SubRequestResponse::__construct public function SubrequestResponse constructor.