QueryValidationContext
in package
implements
ValidationContext
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.
Tags
Interfaces, Classes and Traits
Table of Contents
- $ast : DocumentNode
- $errors : array<string|int, mixed>
- $schema : Schema
- $fragments : array<string|int, mixed>
- $fragmentSpreads : SplObjectStorage
- $recursivelyReferencedFragments : SplObjectStorage
- $recursiveVariableUsages : SplObjectStorage
- $typeInfo : TypeInfo
- $variableUsages : SplObjectStorage
- __construct() : mixed
- getArgument() : Argument|null
- getDirective() : Directive|null
- getDocument() : DocumentNode
- getErrors() : array<int, Error>
- getFieldDef() : FieldDefinition|null
- getFragment() : FragmentDefinitionNode|null
- getFragmentSpreads() : array<int, FragmentSpreadNode>
- getInputType() : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InputType)|null
- getParentInputType() : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InputType)|null
- getParentType() : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\CompositeType&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type)|null
- getRecursivelyReferencedFragments() : array<int, FragmentDefinitionNode>
- getRecursiveVariableUsages() : array<string|int, mixed>
- getSchema() : Schema
- getType() : Type|null
- reportError() : void
- getVariableUsages() : array<string|int, mixed>
Properties
$ast
protected
DocumentNode
$ast
$errors
protected
array<string|int, mixed>
$errors
= []
$schema
protected
Schema
$schema
$fragments
private
array<string|int, mixed>
$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() : Argument|null
Return values
Argument|null —getDirective()
public
getDirective() : Directive|null
Return values
Directive|null —getDocument()
public
getDocument() : DocumentNode
Return values
DocumentNode —getErrors()
public
getErrors() : array<int, Error>
Return values
array<int, Error> —getFieldDef()
public
getFieldDef() : FieldDefinition|null
Return values
FieldDefinition|null —getFragment()
public
getFragment(string $name) : FragmentDefinitionNode|null
Parameters
- $name : string
Return values
FragmentDefinitionNode|null —getFragmentSpreads()
public
getFragmentSpreads(OperationDefinitionNode|FragmentDefinitionNode $node) : array<int, FragmentSpreadNode>
Parameters
Return values
array<int, FragmentSpreadNode> —getInputType()
public
getInputType() : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InputType)|null
Return values
(\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InputType)|null —getParentInputType()
public
getParentInputType() : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InputType)|null
Return values
(\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InputType)|null —getParentType()
public
getParentType() : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\CompositeType&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type)|null
Return values
(\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\CompositeType&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type)|null —getRecursivelyReferencedFragments()
public
getRecursivelyReferencedFragments(OperationDefinitionNode $operation) : array<int, FragmentDefinitionNode>
Parameters
- $operation : OperationDefinitionNode
Return values
array<int, FragmentDefinitionNode> —getRecursiveVariableUsages()
public
getRecursiveVariableUsages(OperationDefinitionNode $operation) : array<string|int, mixed>
Parameters
- $operation : OperationDefinitionNode
Tags
Return values
array<string|int, mixed> —getSchema()
public
getSchema() : Schema
Return values
Schema —getType()
public
getType() : Type|null
Return values
Type|null —reportError()
public
reportError(Error $error) : void
Parameters
- $error : Error
Return values
void —getVariableUsages()
private
getVariableUsages(HasSelectionSet|Node $node) : array<string|int, mixed>
Parameters
- $node : HasSelectionSet|Node
