Automattic\WooCommerce\Vendor\GraphQL\Utils

SchemaExtender::extendArgsprotectedWC 1.0

Method of the class: SchemaExtender{}

No Hooks.

Returns

Array. UnnamedArgumentConfig>

Usage

// protected - for code of main (parent) or child class
$result = $this->extendArgs( $args ): array;
$args(array) (required)
.

SchemaExtender::extendArgs() code WC 10.9.4

protected function extendArgs(array $args): array
{
    $extended = [];
    foreach ($args as $arg) {
        $extendedType = $this->extendType($arg->getType());

        $def = [
            'type' => $extendedType,
            'description' => $arg->description,
            'deprecationReason' => $arg->deprecationReason,
            'astNode' => $arg->astNode,
        ];

        if ($arg->defaultValueExists()) {
            $def['defaultValue'] = $arg->defaultValue;
        }

        $extended[$arg->name] = $def;
    }

    return $extended;
}