PHP Class GraphQL\Validator\Rules\AbstractQuerySecurity

Show file Open project: webonyx/graphql-php

Protected Methods

Method Description
checkIfGreaterOrEqualToZero ( $name, $value ) check if equal to 0 no check is done. Must be greater or equal to 0.
collectFieldASTsAndDefs ( ValidationContext $context, Type | null $parentType, SelectionSetNode $selectionSet, ArrayObject $visitedFragmentNames = null, ArrayObject $astAndDefs = null ) : 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 ( ValidationContext $context )
getFieldName ( FieldNode $node )
getFragment ( FragmentSpreadNode $fragmentSpread )
getFragments ( ) : FragmentDefinitionNode[]
invokeIfNeeded ( ValidationContext $context, array $validators )
isEnabled ( )

Method Details

checkIfGreaterOrEqualToZero() protected method

check if equal to 0 no check is done. Must be greater or equal to 0.
protected checkIfGreaterOrEqualToZero ( $name, $value )
$value

collectFieldASTsAndDefs() protected method

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.
See also: GraphQL\Validator\Rules\OverlappingFieldsCanBeMerged
protected collectFieldASTsAndDefs ( ValidationContext $context, Type | null $parentType, SelectionSetNode $selectionSet, ArrayObject $visitedFragmentNames = null, ArrayObject $astAndDefs = null ) : ArrayObject
$context GraphQL\Validator\ValidationContext
$parentType GraphQL\Type\Definition\Type | null
$selectionSet GraphQL\Language\AST\SelectionSetNode
$visitedFragmentNames ArrayObject
$astAndDefs ArrayObject
return ArrayObject

gatherFragmentDefinition() protected method

protected gatherFragmentDefinition ( ValidationContext $context )
$context GraphQL\Validator\ValidationContext

getFieldName() protected method

protected getFieldName ( FieldNode $node )
$node GraphQL\Language\AST\FieldNode

getFragment() protected method

protected getFragment ( FragmentSpreadNode $fragmentSpread )
$fragmentSpread GraphQL\Language\AST\FragmentSpreadNode

getFragments() protected method

protected getFragments ( ) : FragmentDefinitionNode[]
return GraphQL\Language\AST\FragmentDefinitionNode[]

invokeIfNeeded() protected method

protected invokeIfNeeded ( ValidationContext $context, array $validators )
$context GraphQL\Validator\ValidationContext
$validators array

isEnabled() abstract protected method

abstract protected isEnabled ( )