Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLQueries

GetCoupon::get_field_definitionpublic staticWC 1.0

Method of the class: GetCoupon{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

GetCoupon::get_field_definition() code WC 11.0.1

public static function get_field_definition(): array {
	return array(
		'type'          => CouponType::get(),
		'description'   => __( 'Retrieve a single coupon by ID or code. Exactly one of the two arguments must be provided.', 'woocommerce' ),
		'authorization' => array(
			array(
				'attribute' => 'RequiredCapability',
				'args'      => array(
					0 => 'read_private_shop_coupons',
				),
			),
		),
		'args'          => array(
			'id'   => array(
				'type'         => Type::int(),
				'description'  => __( 'The ID of the coupon to retrieve.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'code' => array(
				'type'         => Type::string(),
				'description'  => __( 'The coupon code to look up.', 'woocommerce' ),
				'defaultValue' => null,
			),
		),
		'resolve'       => array( self::class, 'resolve' ),
	);
}