WooCommerce Code Reference

QueryDepth extends QuerySecurityRule
in package

Table of Contents

DISABLED  = 0
$calculatedFragments  : array<string|int, mixed>
$fragments  : array<string|int, mixed>
$maxQueryDepth  : int
$name  : string
__construct()  : mixed
getMaxQueryDepth()  : int
getName()  : string
getSDLVisitor()  : array<string|int, mixed>
Returns structure suitable for @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Visitor.
getVisitor()  : array<string|int, mixed>
maxQueryDepthErrorMessage()  : string
setMaxQueryDepth()  : void
Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0.
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.
fieldDepth()  : int
gatherFragmentDefinition()  : void
getFieldName()  : string
getFragment()  : FragmentDefinitionNode|null
getFragments()  : array<string, FragmentDefinitionNode>
invokeIfNeeded()  : array<string|int, mixed>
isEnabled()  : bool
nodeDepth()  : int

Constants

Properties

Methods

setMaxQueryDepth()

Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0.

public setMaxQueryDepth(int $maxQueryDepth) : void
Parameters
$maxQueryDepth : int
Tags
throws
InvalidArgumentException
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
see
OverlappingFieldsCanBeMerged
phpstan-param

ASTAndDefs|null $astAndDefs

throws
Exception
throws
ReflectionException
throws
InvariantViolation
phpstan-return

ASTAndDefs

Return values
ArrayObject