PHP Класс GraphQL\Executor\Values

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getArgumentValues ( FieldDefinition | Directive $def, FieldNode | DirectiveNode $node, $variableValues ) : array Prepares an object map of argument values given a list of argument definitions and list of argument AST nodes.
getVariableValues ( Schema $schema, VariableDefinitionNode[] $definitionNodes, array $inputs ) : array Prepares an object map of variables of the correct type based on the provided variable definitions and arbitrary input. If the input cannot be coerced to match the variable definitions, a Error will be thrown.
valueFromAST ( $valueNode, GraphQL\Type\Definition\InputType $type, null $variables = null ) : array | null | stdClass

Приватные методы

Метод Описание
coerceValue ( Type $type, $value ) Given a type and any value, return a runtime value coerced to match the type.
isValidPHPValue ( $value, GraphQL\Type\Definition\InputType $type ) : array Given a PHP value and a GraphQL type, determine if the value will be accepted for that type. This is primarily useful for validating the runtime values of query variables.

Описание методов

getArgumentValues() публичный статический Метод

Prepares an object map of argument values given a list of argument definitions and list of argument AST nodes.
public static getArgumentValues ( FieldDefinition | Directive $def, FieldNode | DirectiveNode $node, $variableValues ) : array
$def GraphQL\Type\Definition\FieldDefinition | GraphQL\Type\Definition\Directive
$node GraphQL\Language\AST\FieldNode | GraphQL\Language\AST\DirectiveNode
$variableValues
Результат array

getVariableValues() публичный статический Метод

Prepares an object map of variables of the correct type based on the provided variable definitions and arbitrary input. If the input cannot be coerced to match the variable definitions, a Error will be thrown.
public static getVariableValues ( Schema $schema, VariableDefinitionNode[] $definitionNodes, array $inputs ) : array
$schema GraphQL\Schema
$definitionNodes GraphQL\Language\AST\VariableDefinitionNode[]
$inputs array
Результат array

valueFromAST() публичный статический Метод

Устаревший: as of 8.0 (Moved to Utils\AST::valueFromAST)
public static valueFromAST ( $valueNode, GraphQL\Type\Definition\InputType $type, null $variables = null ) : array | null | stdClass
$valueNode
$type GraphQL\Type\Definition\InputType
$variables null
Результат array | null | stdClass