You are here

public function ExecutionResult::__sleep in GraphQL 8.4

PHP Serialization: skip some class members when serializing during tests.

File

src/GraphQL/Execution/ExecutionResult.php, line 18

Class

ExecutionResult
Expand the upstream ExecutionResult to make it Drupal cachable.

Namespace

Drupal\graphql\GraphQL\Execution

Code

public function __sleep() : array {

  // PHPUnit error: Fatal error: Uncaught Exception: Serialization of
  // 'Closure' is not allowed.
  // Remove some closure-containing members before serializing.
  $vars = get_object_vars($this);
  unset($vars['extensions']);
  return array_keys($vars);
}