Merge pull request #301 from kidunot89/bugfix/product-review-rating-input-type

Rating input type changed to "Int"
This commit is contained in:
Geoffrey K Taylor
2020-06-22 19:08:23 -04:00
committed by GitHub
+3 -3
View File
@@ -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 );
},