WooCommerce Code Reference

QuerySecurityRule extends ValidationRule
in package

Tags
see

Visitor, FieldDefinition

phpstan-import-type

VisitorArray from Visitor

phpstan-type

ASTAndDefs \ArrayObject<string, \ArrayObject<int, array{FieldNode, FieldDefinition|null}>>

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

Properties

Methods

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
see
OverlappingFieldsCanBeMerged
phpstan-param

ASTAndDefs|null $astAndDefs

throws
Exception
throws
ReflectionException
throws
InvariantViolation
phpstan-return

ASTAndDefs

Return values
ArrayObject