From 5f2fc283d35e8624351bfa7793b8dce2b4240186 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Tue, 31 Oct 2023 16:17:41 -0400 Subject: [PATCH 1/2] fix: ProductAttributeEnum no longer registered if no attribute exist --- includes/type/enum/class-product-attribute-enum.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/type/enum/class-product-attribute-enum.php b/includes/type/enum/class-product-attribute-enum.php index a5313562..8e0b112e 100644 --- a/includes/type/enum/class-product-attribute-enum.php +++ b/includes/type/enum/class-product-attribute-enum.php @@ -32,6 +32,10 @@ public static function register() { } } + if ( empty( $taxonomy_values ) ) { + return; + } + register_graphql_enum_type( 'ProductAttributeEnum', [ From c97ed170d5665ba0d75922c4c8ddeaf3949e9232 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Tue, 31 Oct 2023 16:40:33 -0400 Subject: [PATCH 2/2] fix: ProductAttributeEnum default value provided --- includes/type/enum/class-product-attribute-enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/type/enum/class-product-attribute-enum.php b/includes/type/enum/class-product-attribute-enum.php index 8e0b112e..db30fdef 100644 --- a/includes/type/enum/class-product-attribute-enum.php +++ b/includes/type/enum/class-product-attribute-enum.php @@ -33,7 +33,7 @@ public static function register() { } if ( empty( $taxonomy_values ) ) { - return; + $taxonomy_values['NONE'] = [ 'value' => 'none' ]; } register_graphql_enum_type(