Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output

SelectedAttribute{}WC 1.0

No Hooks.

Usage

$SelectedAttribute = new SelectedAttribute();
// use class methods

Methods

  1. public static get()

SelectedAttribute{} code WC 10.9.1

class SelectedAttribute {
	private static ?ObjectType $instance = null;

	public static function get(): ObjectType {
		if ( null === self::$instance ) {
			self::$instance = new ObjectType(
				array(
					'name'        => 'SelectedAttribute',
					'description' => __( 'A selected attribute value on a product variation.', 'woocommerce' ),
					'fields'      => fn() => array(
						'name'  => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The attribute name or slug.', 'woocommerce' ),
						),
						'value' => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The selected attribute value.', 'woocommerce' ),
						),
					),
				)
			);
		}
		return self::$instance;
	}
}