src/Schema/Factories/ArgumentFactory.php
public function handle(ArgumentValue $argumentValue): array
    {
        $definition = $argumentValue->getAstNode();

        $argumentType = $argumentValue->getType();

        $fieldArgument = [
            'name' => $argumentValue->getName(),
            'description' => data_get($definition->description, 'value'),
            'type' => $argumentType,
            'astNode' => $definition,
        ];

        if ($defaultValue = $definition->defaultValue) {
            $fieldArgument += [
                // webonyx/graphql-php expects the internal value here, whereas the
                // SDL uses the ENUM's name, so we run the conversion here
                'defaultValue' => $argumentType instanceof EnumType
                    ? $argumentType->getValue($defaultValue->value)->value
                    : AST::valueFromASTUntyped($defaultValue),
            ];
        }

        // Add any dynamically declared public properties of the FieldArgument
        $fieldArgument += get_object_vars($argumentValue);

        // Used to construct a FieldArgument class
        return $fieldArgument;
    }
public function handle(ArgumentValue $argumentValue): array
    {
        $definition = $argumentValue->getAstNode();

        $argumentType = $argumentValue->getType();

        $fieldArgument = [
            'name' => $argumentValue->getName(),
            'description' => data_get($definition->description, 'value'),
            'type' => $argumentType,
            'astNode' => $definition,
        ];

        if ($defaultValue = $definition->defaultValue) {
            $fieldArgument += [
                // webonyx/graphql-php expects the internal value here, whereas the
                // SDL uses the ENUM's name, so we run the conversion here
                'defaultValue' => $argumentType instanceof EnumType
                    ? $argumentType->getValue($defaultValue->value)->value
                    : AST::valueFromASTUntyped($defaultValue),
            ];
        }

        // Add any dynamically declared public properties of the FieldArgument
        $fieldArgument += get_object_vars($argumentValue);

        // Used to construct a FieldArgument class
        return $fieldArgument;
    }
public function handle ( ArgumentValue $ argumentValue ) : array { $ definition = $ argumentValue -> getAstNode ( ) ; $ argumentType = $ argumentValue -> getType ( ) ; $ fieldArgument = [ 'name' => $ argumentValue -> getName ( ) , 'description' => data_get ( $ definition -> description , 'value' ) , 'type' => $ argumentType , 'astNode' => $ definition , ] ; if ( $ defaultValue = $ definition -> defaultValue ) { $ fieldArgument += [ // webonyx/graphql-php expects the internal value here, whereas the // SDL uses the ENUM's name, so we run the conversion here 'defaultValue' => $ argumentType instanceof EnumType ? $ argumentType -> getValue ( $ defaultValue -> value ) -> value : AST :: valueFromASTUntyped ( $ defaultValue ) , ] ; } // Add any dynamically declared public properties of the FieldArgument $ fieldArgument += get_object_vars ( $ argumentValue ) ; // Used to construct a FieldArgument class return $ fieldArgument ; }
Convert argument definition to type.

@param  \Nuwave\Lighthouse\Schema\Values\ArgumentValue  $argumentValue
@return array
Convert argument definition to type .