mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
Merge pull request #301 from kidunot89/bugfix/product-review-rating-input-type
Rating input type changed to "Int"
This commit is contained in:
@@ -50,7 +50,7 @@ class Review_Write {
|
||||
$comment_input_fields,
|
||||
array(
|
||||
'rating' => array(
|
||||
'type' => array( 'non_null' => 'Float' ),
|
||||
'type' => array( 'non_null' => 'Int' ),
|
||||
'description' => __( 'Product rating', 'wp-graphql-woocommerce' ),
|
||||
),
|
||||
)
|
||||
@@ -71,7 +71,7 @@ class Review_Write {
|
||||
if ( ! isset( $payload['id'] ) || ! absint( $payload['id'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return (float) get_comment_meta( $payload['id'], 'rating', true );
|
||||
}
|
||||
),
|
||||
@@ -82,7 +82,7 @@ class Review_Write {
|
||||
if ( ! isset( $payload['id'] ) || ! absint( $payload['id'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$comment = get_comment( $payload['id'] );
|
||||
return new Comment( $comment );
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user