Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLMutations

DeleteCoupon::get_field_definitionpublic staticWC 1.0

Method of the class: DeleteCoupon{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

DeleteCoupon::get_field_definition() code WC 10.9.4

public static function get_field_definition(): array {
	return array(
		'type'          => Type::nonNull( DeleteCouponResultType::get() ),
		'description'   => __( 'Delete a coupon.', 'woocommerce' ),
		'authorization' => array(
			array(
				'attribute' => 'RequiredCapability',
				'args'      => array(
					0 => 'manage_woocommerce',
				),
			),
		),
		'args'          => array(
			'id'    => array(
				'type'        => Type::nonNull( Type::int() ),
				'description' => __( 'The ID of the coupon to delete.', 'woocommerce' ),
			),
			'force' => array(
				'type'         => Type::nonNull( Type::boolean() ),
				'description'  => __( 'Whether to permanently delete the coupon (bypass trash).', 'woocommerce' ),
				'defaultValue' => false,
			),
		),
		'resolve'       => array( self::class, 'resolve' ),
	);
}