PHP Class GraphQL\Executor\Values

Afficher le fichier Open project: webonyx/graphql-php Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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.

Method Details

getArgumentValues() public static méthode

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
Résultat array

getVariableValues() public static méthode

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
Résultat array

valueFromAST() public static méthode

Deprecation: 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
Résultat array | null | stdClass