wp-graphql-woocommerce
                                
                                
                                
                                    wp-graphql-woocommerce copied to clipboard
                            
                            
                            
                        Stock quantity not decreased when creating an order.
If you create an order through the dashboard, and mark it as complete, it will substract the quantity of the items in the order from the stock quantity. However, when creating an order through graphql, marked as paid and complete, it will not subtract the quantity of the item from the stock quantity.
I ran this query:
mutation MyMutation {
  __typename
  createOrder(input: {clientMutationId: "uniqueId", lineItems: {quantity: 3, productId: 3007}, status: COMPLETED, isPaid: true, paymentMethod: "cash", transactionId: "123", currency: "USD"}) {
    order {
      lineItems {
        nodes {
          product {
            name
            ... on SimpleProduct {
              id
              name
              stockQuantity
            }
          }
        }
      }
    }
  }
}
and the stock quantity returned as well as the one in the database was not changed after running the query.
Expected behaviour: It should behave as the portal behaves, when creating an order as completed, the product quantity should be subtracted from stock quantity.
Have you tried using the checkout mutation instead?
(But the bug with createOrder will still be there)
@vikramkh Any updates on this issue?