Skip to content

Commit 4bdf283

Browse files
authored
fix: Fixes order return type for guest. (#723)
1 parent 461caad commit 4bdf283

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

includes/connection/class-orders.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ 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 [];
113+
return [
114+
'nodes' => [],
115+
'edges' => [],
116+
];
114117
}
115118

116119
$meta_query = false;
@@ -140,7 +143,10 @@ private static function get_customer_order_connection( $resolver, $customer ) {
140143

141144
// Bail if needed info not found on customer object.
142145
if ( false === $meta_query ) {
143-
return [];
146+
return [
147+
'nodes' => [],
148+
'edges' => [],
149+
];
144150
}
145151

146152
$resolver->set_query_arg( 'meta_query', $meta_query );

0 commit comments

Comments
 (0)