QuerySecurityRule
extends ValidationRule
in package
Tags
Table of Contents
- DISABLED = 0
- $fragments : array<string|int, mixed>
- $name : string
- getName() : string
- getSDLVisitor() : array<string|int, mixed>
- Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
- getVisitor() : array<string|int, mixed>
- Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
- checkIfGreaterOrEqualToZero() : void
- collectFieldASTsAndDefs() : ArrayObject
- Given a selectionSet, adds all fields in that selection to the passed in map of fields, and returns it at the end.
- gatherFragmentDefinition() : void
- getFieldName() : string
- getFragment() : FragmentDefinitionNode|null
- getFragments() : array<string, FragmentDefinitionNode>
- invokeIfNeeded() : array<string|int, mixed>
- isEnabled() : bool
Constants
DISABLED
public
mixed
DISABLED
= ""
Properties
$fragments
protected
array<string|int, mixed>
$fragments
= []
$name
protected
string
$name
Methods
getName()
public
getName() : string
Return values
string —getSDLVisitor()
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
public
getSDLVisitor(SDLValidationContext $context) : array<string|int, mixed>
Parameters
- $context : SDLValidationContext
Tags
Return values
array<string|int, mixed> —getVisitor()
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
public
getVisitor(QueryValidationContext $context) : array<string|int, mixed>
Parameters
- $context : QueryValidationContext
Tags
Return values
array<string|int, mixed> —checkIfGreaterOrEqualToZero()
protected
checkIfGreaterOrEqualToZero(string $name, int $value) : void
Parameters
- $name : string
- $value : int
Tags
Return values
void —collectFieldASTsAndDefs()
Given a selectionSet, adds all fields in that selection to the passed in map of fields, and returns it at the end.
protected
collectFieldASTsAndDefs(QueryValidationContext $context, Type|null $parentType, SelectionSetNode $selectionSet[, ArrayObject<string, true>|null $visitedFragmentNames = null ][, ArrayObject|null $astAndDefs = null ]) : ArrayObject
Note: This is not the same as execution's collectFields because at static time we do not know what object type will be used, so we unconditionally spread in all fragments.
Parameters
- $context : QueryValidationContext
- $parentType : Type|null
- $selectionSet : SelectionSetNode
- $visitedFragmentNames : ArrayObject<string, true>|null = null
- $astAndDefs : ArrayObject|null = null
Tags
Return values
ArrayObject —gatherFragmentDefinition()
protected
gatherFragmentDefinition(QueryValidationContext $context) : void
Parameters
- $context : QueryValidationContext
Return values
void —getFieldName()
protected
getFieldName(FieldNode $node) : string
Parameters
- $node : FieldNode
Return values
string —getFragment()
protected
getFragment(FragmentSpreadNode $fragmentSpread) : FragmentDefinitionNode|null
Parameters
- $fragmentSpread : FragmentSpreadNode
Return values
FragmentDefinitionNode|null —getFragments()
protected
getFragments() : array<string, FragmentDefinitionNode>
Return values
array<string, FragmentDefinitionNode> —invokeIfNeeded()
protected
invokeIfNeeded(QueryValidationContext $context, array<string|int, mixed> $validators) : array<string|int, mixed>
Parameters
- $context : QueryValidationContext
- $validators : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —isEnabled()
protected
abstract isEnabled() : bool
