Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace GraphQL\Validator;
|
||||
|
||||
use GraphQL\Error\Error;
|
||||
use GraphQL\Language\AST\DocumentNode;
|
||||
use GraphQL\Type\Schema;
|
||||
|
||||
abstract class ASTValidationContext
|
||||
{
|
||||
/** @var DocumentNode */
|
||||
protected $ast;
|
||||
|
||||
/** @var Error[] */
|
||||
protected $errors;
|
||||
|
||||
/** @var Schema */
|
||||
protected $schema;
|
||||
|
||||
public function __construct(DocumentNode $ast, ?Schema $schema = null)
|
||||
{
|
||||
$this->ast = $ast;
|
||||
$this->schema = $schema;
|
||||
$this->errors = [];
|
||||
}
|
||||
|
||||
public function reportError(Error $error)
|
||||
{
|
||||
$this->errors[] = $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Error[]
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DocumentNode
|
||||
*/
|
||||
public function getDocument()
|
||||
{
|
||||
return $this->ast;
|
||||
}
|
||||
|
||||
public function getSchema() : ?Schema
|
||||
{
|
||||
return $this->schema;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user