mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 21:06:05 +03:00
Allow passing custom TypeInfo to validate
This commit is contained in:
parent
a53b798f29
commit
189877c173
@ -122,9 +122,9 @@ class DocumentValidator
|
||||
self::$rules[$name] = $rule;
|
||||
}
|
||||
|
||||
public static function validate(Schema $schema, DocumentNode $ast, array $rules = null)
|
||||
public static function validate(Schema $schema, DocumentNode $ast, array $rules = null, TypeInfo $typeInfo = null)
|
||||
{
|
||||
$typeInfo = new TypeInfo($schema);
|
||||
$typeInfo = $typeInfo ?: new TypeInfo($schema);
|
||||
$errors = static::visitUsingRules($schema, $typeInfo, $ast, $rules ?: static::allRules());
|
||||
return $errors;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user