wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
updateOrder not update order status
Describe the bug The updateOrder mutation is not updating the order status sending in UpdateOrderInput status, just update sending isPaid true.
To Reproduce Steps to reproduce the behavior:
-
Mutation to run.
mutation UpdateOrder($input: UpdateOrderInput!) { updateOrder(input: $input) { order { status } } } -
Input to send.
{ "input": { "orderId": 84808, "status": "FAILED" } }
Expected behavior I expect that the order status update to the status enum sended, in this case is "FAILED" but it returns me the actual order status.
Screenshots

Plugin Versions
- WooGraphQL Version: 0.10.2
- WPGraphQL Version: 1.1.8
- WordPress Version: 5.6.1
- WooCommerce Version: 5.0.0
@brandonqcode it can be fixed by updating plugin code. in file wp-graphql-woocommerce-develop/includes/mutation/class-order-update.php line no 142.
Change
$order->set_status( $input['status'] );
with this
$order->update_status( $input['status'] );
@kidunot89 i have created pull request for the same