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

ProductReview::getpublic staticWC 1.0

Method of the class: ProductReview{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = ProductReview::get(): ObjectType;

ProductReview::get() code WC 10.9.1

public static function get(): ObjectType {
	if ( null === self::$instance ) {
		self::$instance = new ObjectType(
			array(
				'name'        => 'ProductReview',
				'description' => __( 'Represents a customer review for a product.', 'woocommerce' ),
				'fields'      => fn() => array(
					'id'           => array(
						'type'        => Type::nonNull( Type::int() ),
						'description' => __( 'The review ID.', 'woocommerce' ),
					),
					'product_id'   => array(
						'type'        => Type::nonNull( Type::int() ),
						'description' => __( 'The product ID this review belongs to.', 'woocommerce' ),
					),
					'reviewer'     => array(
						'type'        => Type::nonNull( Type::string() ),
						'description' => __( 'The reviewer name.', 'woocommerce' ),
					),
					'review'       => array(
						'type'        => Type::nonNull( Type::string() ),
						'description' => __( 'The review content.', 'woocommerce' ),
					),
					'rating'       => array(
						'type'        => Type::nonNull( Type::int() ),
						'description' => __( 'The review rating (1-5).', 'woocommerce' ),
					),
					'date_created' => array(
						'type'        => DateTimeType::get(),
						'description' => __( 'The date the review was created.', 'woocommerce' ),
					),
				),
			)
		);
	}
	return self::$instance;
}