Skip to content

Commit 173bea0

Browse files
authored
Fix: Null state for coupon and order connections. (#523)
1 parent 2ea8591 commit 173bea0

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

includes/connection/class-coupons.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ public static function get_connection_config( $args = array() ): array {
4646
$resolver = new PostObjectConnectionResolver( $source, $args, $context, $info, 'shop_coupon' );
4747

4848
if ( ! self::should_execute() ) {
49-
return array(
50-
'nodes' => array(),
51-
'edges' => array(),
52-
);
49+
return array();
5350
}
5451

5552
return $resolver->get_connection();

includes/connection/class-orders.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,7 @@ public static function register_connections() {
110110
private static function get_customer_order_connection( $resolver, $customer ) {
111111
// If not "billing email" or "ID" set bail early by returning an empty connection.
112112
if ( empty( $customer->get_billing_email() ) && empty( $customer->get_id() ) ) {
113-
return array(
114-
'pageInfo' => null,
115-
'nodes' => array(),
116-
'edges' => array(),
117-
);
113+
return array();
118114
}
119115

120116
// If the querying user has a "billing email" set filter orders by user's billing email, otherwise filter by user's ID.

0 commit comments

Comments
 (0)