You are here

class ArticleResponse in GraphQL 8.4

Same name in this branch
  1. 8.4 examples/graphql_composable/src/GraphQL/Response/ArticleResponse.php \Drupal\graphql_composable\GraphQL\Response\ArticleResponse
  2. 8.4 examples/graphql_composable/src/Wrappers/Response/ArticleResponse.php \Drupal\graphql_composable\Wrappers\Response\ArticleResponse

Type of response used when an article is returned.

Hierarchy

Expanded class hierarchy of ArticleResponse

2 files declare their use of ArticleResponse
ComposableSchemaExampleExtension.php in examples/graphql_composable/src/Plugin/GraphQL/SchemaExtension/ComposableSchemaExampleExtension.php
CreateArticle.php in examples/graphql_composable/src/Plugin/GraphQL/DataProducer/CreateArticle.php
2 string references to 'ArticleResponse'
ComposableSchemaExampleExtension::registerResolvers in examples/graphql_composable/src/Plugin/GraphQL/SchemaExtension/ComposableSchemaExampleExtension.php
Registers type and field resolvers in the shared registry.
ComposableSchemaExampleExtension::resolveResponse in examples/graphql_composable/src/Plugin/GraphQL/SchemaExtension/ComposableSchemaExampleExtension.php
Resolves the response type.

File

examples/graphql_composable/src/GraphQL/Response/ArticleResponse.php, line 11

Namespace

Drupal\graphql_composable\GraphQL\Response
View source
class ArticleResponse extends Response {

  /**
   * The article to be served.
   *
   * @var \Drupal\Core\Entity\EntityInterface|null
   */
  protected $article;

  /**
   * Sets the content.
   *
   * @param \Drupal\Core\Entity\EntityInterface|null $article
   *   The article to be served.
   */
  public function setArticle(?EntityInterface $article) : void {
    $this->article = $article;
  }

  /**
   * Gets the article to be served.
   *
   * @return \Drupal\Core\Entity\EntityInterface|null
   *   The article to be served.
   */
  public function article() : ?EntityInterface {
    return $this->article;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ArticleResponse::$article protected property The article to be served.
ArticleResponse::article public function Gets the article to be served.
ArticleResponse::setArticle public function Sets the content.
Response::$violations protected property List of violations.
Response::addViolation public function Adds the violation. Overrides ResponseInterface::addViolation
Response::addViolations public function Adds multiple violations. Overrides ResponseInterface::addViolations
Response::getViolations public function Gets the violations. Overrides ResponseInterface::getViolations
Response::mergeViolations public function Adds the violations from another response to this response. Overrides ResponseInterface::mergeViolations