Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLQueries

GetProduct::get_field_definitionpublic staticWC 1.0

Method of the class: GetProduct{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = GetProduct::get_field_definition(): array;

GetProduct::get_field_definition() code WC 10.9.1

public static function get_field_definition(): array {
	return array(
		'type'          => ProductInterface::get(),
		'description'   => __( 'Retrieve a single product by ID.', 'woocommerce' ),
		'authorization' => array(
			array(
				'attribute' => 'RequiredCapability',
				'args'      => array(
					0 => 'read_product',
				),
			),
		),
		'args'          => array(
			'id' => array(
				'type'        => Type::nonNull( Type::int() ),
				'description' => __( 'The ID of the product to retrieve.', 'woocommerce' ),
			),
		),
		'resolve'       => array( self::class, 'resolve' ),
	);
}