Documentation

QueryDepth extends QuerySecurityRule
in package

Table of Contents

DISABLED  = 0
$name  : string
$fragments  : array<string|int, FragmentDefinitionNode>
$maxQueryDepth  : int
__construct()  : mixed
__invoke()  : mixed
getMaxQueryDepth()  : mixed
getName()  : mixed
getSDLVisitor()  : array<string|int, mixed>
Returns structure suitable for GraphQL\Language\Visitor
getVisitor()  : mixed
maxQueryDepthErrorMessage()  : mixed
setMaxQueryDepth()  : mixed
Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0.
checkIfGreaterOrEqualToZero()  : mixed
check if equal to 0 no check is done. Must be greater or equal to 0.
collectFieldASTsAndDefs()  : ArrayObject
Given a selectionSet, adds all of the fields in that selection to the passed in map of fields, and returns it at the end.
gatherFragmentDefinition()  : mixed
getFieldName()  : mixed
getFragment()  : mixed
getFragments()  : array<string|int, FragmentDefinitionNode>
invokeIfNeeded()  : array<string|int, callable>
isEnabled()  : mixed
fieldDepth()  : mixed
nodeDepth()  : mixed

Constants

Properties

Methods

__construct()

public __construct(mixed $maxQueryDepth) : mixed
Parameters
$maxQueryDepth : mixed
Return values
mixed

getMaxQueryDepth()

public getMaxQueryDepth() : mixed
Return values
mixed

maxQueryDepthErrorMessage()

public static maxQueryDepthErrorMessage(mixed $max, mixed $count) : mixed
Parameters
$max : mixed
$count : mixed
Return values
mixed

setMaxQueryDepth()

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

public setMaxQueryDepth(mixed $maxQueryDepth) : mixed
Parameters
$maxQueryDepth : mixed
Return values
mixed

checkIfGreaterOrEqualToZero()

check if equal to 0 no check is done. Must be greater or equal to 0.

protected checkIfGreaterOrEqualToZero(string $name, int $value) : mixed
Parameters
$name : string
$value : int
Return values
mixed

collectFieldASTsAndDefs()

Given a selectionSet, adds all of the fields in that selection to the passed in map of fields, and returns it at the end.

protected collectFieldASTsAndDefs(ValidationContext $context, Type|null $parentType, SelectionSetNode $selectionSet[, ArrayObject|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 : ValidationContext
$parentType : Type|null
$selectionSet : SelectionSetNode
$visitedFragmentNames : ArrayObject|null = null
$astAndDefs : ArrayObject|null = null
Tags
see
OverlappingFieldsCanBeMerged
Return values
ArrayObject

invokeIfNeeded()

protected invokeIfNeeded(ValidationContext $context, array<string|int, callable> $validators) : array<string|int, callable>
Parameters
$context : ValidationContext
$validators : array<string|int, callable>
Return values
array<string|int, callable>

isEnabled()

protected isEnabled() : mixed
Return values
mixed

fieldDepth()

private fieldDepth(mixed $node, mixed $depth, mixed $maxDepth) : mixed
Parameters
$node : mixed
$depth : mixed
$maxDepth : mixed
Return values
mixed

nodeDepth()

private nodeDepth(Node $node, mixed $depth, mixed $maxDepth) : mixed
Parameters
$node : Node
$depth : mixed
$maxDepth : mixed
Return values
mixed

Search results