PHP Class GraphQL\Type\Definition\ResolveInfo

Show file Open project: webonyx/graphql-php Class Usage Examples

Public Properties

Property Type Description
$fieldASTs GraphQL\Language\AST\FieldNode[]
$fieldName string
$fieldNodes GraphQL\Language\AST\FieldNode[]
$fragments GraphQL\Language\AST\FragmentDefinitionNode[]
$operation GraphQL\Language\AST\OperationDefinitionNode
$parentType Type | CompositeType
$path array
$returnType OutputType
$rootValue mixed
$schema GraphQL\Schema
$variableValues

Public Methods

Method Description
__construct ( array $values )
__get ( $name )
getFieldSelection ( integer $depth ) : array Helper method that returns names of all fields selected in query for $this->fieldName up to $depth levels

Private Methods

Method Description
foldSelectionSet ( SelectionSetNode $selectionSet, $descend )

Method Details

__construct() public method

public __construct ( array $values )
$values array

__get() public method

public __get ( $name )

getFieldSelection() public method

query AppHomeRoute{viewer{id,..._0c28183ce}} fragment _0c28183ce on Viewer{id,profile{firstName,id,locations{id}}} Example: query MyQuery{ { root { id, nested { nested1 nested2 { nested3 } } } } Given this ResolveInfo instance is a part of "root" field resolution, and $depth === 1, method will return: [ 'id' => true, 'nested' => [ nested1 => true, nested2 => true ] ]
public getFieldSelection ( integer $depth ) : array
$depth integer How many levels to include in output
return array

Property Details

$fieldASTs public property

Deprecation: as of 8.0 (Renamed to $fieldNodes)
public FieldNode[],GraphQL\Language\AST $fieldASTs
return GraphQL\Language\AST\FieldNode[]

$fieldName public property

public string $fieldName
return string

$fieldNodes public property

public FieldNode[],GraphQL\Language\AST $fieldNodes
return GraphQL\Language\AST\FieldNode[]

$fragments public property

public FragmentDefinitionNode[],GraphQL\Language\AST $fragments
return GraphQL\Language\AST\FragmentDefinitionNode[]

$operation public property

public OperationDefinitionNode,GraphQL\Language\AST $operation
return GraphQL\Language\AST\OperationDefinitionNode

$parentType public property

public Type,GraphQL\Type\Definition|CompositeType $parentType
return Type | CompositeType

$path public property

public array $path
return array

$returnType public property

public OutputType $returnType
return OutputType

$rootValue public property

public mixed $rootValue
return mixed

$schema public property

public Schema,GraphQL $schema
return GraphQL\Schema

$variableValues public property

public $variableValues