You are here

interface ResponseInterface in GraphQL 8.4

Response interface used for GraphQL responses.

Hierarchy

Expanded class hierarchy of ResponseInterface

All classes that implement ResponseInterface

2 files declare their use of ResponseInterface
ComposableSchemaExampleExtension.php in examples/graphql_composable/src/Plugin/GraphQL/SchemaExtension/ComposableSchemaExampleExtension.php
PasswordReset.php in src/Plugin/GraphQL/DataProducer/User/PasswordReset.php

File

src/GraphQL/Response/ResponseInterface.php, line 10

Namespace

Drupal\graphql\GraphQL\Response
View source
interface ResponseInterface {

  /**
   * Adds the violation.
   *
   * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $message
   *   Violation message.
   * @param array $properties
   *   Other properties related to the violation.
   */
  public function addViolation($message, array $properties = []) : void;

  /**
   * Adds multiple violations.
   *
   * @param string[]|\Drupal\Core\StringTranslation\TranslatableMarkup[] $messages
   *   Violation messages.
   * @param array $properties
   *   Other properties related to the violation.
   */
  public function addViolations(array $messages, array $properties = []) : void;

  /**
   * Gets the violations.
   *
   * @return array
   *   Violations.
   */
  public function getViolations() : array;

  /**
   * Adds the violations from another response to this response.
   */
  public function mergeViolations(ResponseInterface $source) : void;

}

Members

Namesort descending Modifiers Type Description Overrides
ResponseInterface::addViolation public function Adds the violation. 1
ResponseInterface::addViolations public function Adds multiple violations. 1
ResponseInterface::getViolations public function Gets the violations. 1
ResponseInterface::mergeViolations public function Adds the violations from another response to this response. 1