ValidationContext
extends ASTValidationContext
in package
An instance of this class is passed as the "this" context to all validators, allowing access to commonly useful contextual information from within a validation rule.
Table of Contents
- $ast : DocumentNode
- $errors : array<string|int, Error>
- $schema : Schema
- $fragments : array<string|int, FragmentDefinitionNode>
- $fragmentSpreads : SplObjectStorage
- $recursivelyReferencedFragments : SplObjectStorage
- $recursiveVariableUsages : SplObjectStorage
- $typeInfo : TypeInfo
- $variableUsages : SplObjectStorage
- __construct() : mixed
- getArgument() : mixed
- getDirective() : mixed
- getDocument() : DocumentNode
- getErrors() : array<string|int, Error>
- getFieldDef() : FieldDefinition
- getFragment() : FragmentDefinitionNode|null
- getFragmentSpreads() : array<string|int, FragmentSpreadNode>
- getInputType() : InputType|null
- getParentInputType() : (\GraphQL\Type\Definition\Type&\GraphQL\Type\Definition\InputType)|null
- getParentType() : CompositeType|null
- getRecursivelyReferencedFragments() : array<string|int, FragmentDefinitionNode>
- getRecursiveVariableUsages() : array<string|int, array<string|int, mixed>>
- getSchema() : Schema|null
- getType() : OutputType|null
- reportError() : mixed
- getVariableUsages() : array<string|int, array<string|int, mixed>>
Properties
$ast
protected
DocumentNode
$ast
$errors
protected
array<string|int, Error>
$errors
$schema
protected
Schema
$schema
$fragments
private
array<string|int, FragmentDefinitionNode>
$fragments
$fragmentSpreads
private
SplObjectStorage
$fragmentSpreads
$recursivelyReferencedFragments
private
SplObjectStorage
$recursivelyReferencedFragments
$recursiveVariableUsages
private
SplObjectStorage
$recursiveVariableUsages
$typeInfo
private
TypeInfo
$typeInfo
$variableUsages
private
SplObjectStorage
$variableUsages
Methods
__construct()
public
__construct(Schema $schema, DocumentNode $ast, TypeInfo $typeInfo) : mixed
Parameters
- $schema : Schema
- $ast : DocumentNode
- $typeInfo : TypeInfo
Return values
mixed —getArgument()
public
getArgument() : mixed
Return values
mixed —getDirective()
public
getDirective() : mixed
Return values
mixed —getDocument()
public
getDocument() : DocumentNode
Return values
DocumentNode —getErrors()
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error> —getFieldDef()
public
getFieldDef() : FieldDefinition
Return values
FieldDefinition —getFragment()
public
getFragment(string $name) : FragmentDefinitionNode|null
Parameters
- $name : string
Return values
FragmentDefinitionNode|null —getFragmentSpreads()
public
getFragmentSpreads(OperationDefinitionNode|FragmentDefinitionNode $node) : array<string|int, FragmentSpreadNode>
Parameters
Return values
array<string|int, FragmentSpreadNode> —getInputType()
public
getInputType() : InputType|null
Return values
InputType|null —getParentInputType()
public
getParentInputType() : (\GraphQL\Type\Definition\Type&\GraphQL\Type\Definition\InputType)|null
Return values
(\GraphQL\Type\Definition\Type&\GraphQL\Type\Definition\InputType)|null —getParentType()
public
getParentType() : CompositeType|null
Return values
CompositeType|null —getRecursivelyReferencedFragments()
public
getRecursivelyReferencedFragments(OperationDefinitionNode $operation) : array<string|int, FragmentDefinitionNode>
Parameters
- $operation : OperationDefinitionNode
Return values
array<string|int, FragmentDefinitionNode> —getRecursiveVariableUsages()
public
getRecursiveVariableUsages(OperationDefinitionNode $operation) : array<string|int, array<string|int, mixed>>
Parameters
- $operation : OperationDefinitionNode
Return values
array<string|int, array<string|int, mixed>> —List of ['node' => VariableNode, 'type' => ?InputObjectType]
getSchema()
public
getSchema() : Schema|null
Return values
Schema|null —getType()
public
getType() : OutputType|null
Return values
OutputType|null —reportError()
public
reportError(Error $error) : mixed
Parameters
- $error : Error
Return values
mixed —getVariableUsages()
private
getVariableUsages(HasSelectionSet $node) : array<string|int, array<string|int, mixed>>
Parameters
- $node : HasSelectionSet
Return values
array<string|int, array<string|int, mixed>> —List of ['node' => VariableNode, 'type' => ?InputObjectType]