Skip to content

fillCart doesn't report the coupon errors #458

Open
@aresrioja10

Description

@aresrioja10

Describe the bug
I'm trying to execute the fillCart mutation with one invalid coupon code and it doesn't return the errors.

To Reproduce
Execute the following mutation. In my case, I've created a coupon "somecode" with a minimum price of 500€. The product with the ID 2610 costs 366,12€ so the coupon is invalid in that case.

mutation fillCart {
  fillCart(input: {items: {productId: 2610, variationId: 4833, quantity: 1}, coupons: ["somecode"]}) {
    added {
      subtotal
      quantity
      product {
        node {
          databaseId
        }
      }
    }
    applied {
      code
      discountAmount
      discountTax
    }
    cartErrors {
      reasons
      ... on CouponError {
        reasons
      }
    }
  }
}

Expected behavior
It should fill the cartErrors field with the error message. Instead, it returns the following response:

"data": {
    "fillCart": {
      "added": [
        {
          "subtotal": "366,12 €",
          "quantity": 1,
          "product": {
            "node": {
              "databaseId": 2610
            }
          }
        }
      ],
      "applied": null,
      "cartErrors": []
    }
  }

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome

Plugin Versions

  • WooGraphQL Version: 0.8.1
  • WPGraphQL Version: 1.3.2
  • **WordPress Version: 5.7
  • **WooCommerce Version: 5.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions