You are here

public function Response::addViolation in GraphQL 8.4

Adds the violation.

Parameters

string|\Drupal\Core\StringTranslation\TranslatableMarkup $message: Violation message.

array $properties: Other properties related to the violation.

Overrides ResponseInterface::addViolation

1 call to Response::addViolation()
Response::addViolations in src/GraphQL/Response/Response.php
Adds multiple violations.

File

src/GraphQL/Response/Response.php, line 22

Class

Response
Base class for responses containing the violations.

Namespace

Drupal\graphql\GraphQL\Response

Code

public function addViolation($message, array $properties = []) : void {
  $properties['message'] = (string) $message;
  $this->violations[] = $properties;
}