Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLMutations

CreateCoupon::get_field_definitionpublic staticWC 1.0

Method of the class: CreateCoupon{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

CreateCoupon::get_field_definition() code WC 10.9.1

public static function get_field_definition(): array {
	return array(
		'type'          => Type::nonNull( CouponType::get() ),
		'description'   => __( 'Create a new coupon.', 'woocommerce' ),
		'authorization' => array(
			array(
				'attribute' => 'RequiredCapability',
				'args'      => array(
					0 => 'manage_woocommerce',
				),
			),
		),
		'args'          => array(
			'input' => array(
				'type'        => Type::nonNull( CreateCouponInput::get() ),
				'description' => __( 'Data for the new coupon.', 'woocommerce' ),
			),
		),
		'resolve'       => array( self::class, 'resolve' ),
	);
}