*/ public $fragments; /** * @var */ public $root; /** * @var OperationDefinition */ public $operation; /** * @var array */ public $variables; /** * @var array */ public $errors; public function __construct($schema, $fragments, $root, $operation, $variables, $errors) { $this->schema = $schema; $this->fragments = $fragments; $this->root = $root; $this->operation = $operation; $this->variables = $variables; $this->errors = $errors ?: []; } public function addError($error) { $this->errors[] = $error; return $this; } }