mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
"label" field added.
This commit is contained in:
committed by
Geoff Taylor
parent
757bf0aa91
commit
8c7951bdde
@@ -61,6 +61,13 @@ class Product_Attribute {
|
||||
return ! empty( $attribute->get_name() ) ? $attribute->get_name() : null;
|
||||
},
|
||||
),
|
||||
'label' => array(
|
||||
'type' => array( 'non_null' => 'String' ),
|
||||
'description' => __( 'Attribute label', 'wp-graphql-woocommerce' ),
|
||||
'resolve' => function ( $attribute ) {
|
||||
return ! empty( $attribute->get_name() ) ? ucwords( $attribute->get_name() ) : null;
|
||||
},
|
||||
),
|
||||
'options' => array(
|
||||
'type' => array( 'list_of' => 'String' ),
|
||||
'description' => __( 'Attribute options', 'wp-graphql-woocommerce' ),
|
||||
|
||||
Reference in New Issue
Block a user