magento / graphql-ce

[ARCHIVED] Please use magento/magento2 project
https://github.com/magento/magento2
Open Software License 3.0
131 stars 156 forks source link

ShippingAddressInput.postcode: String, is not required by Schema #961

Closed TomashKhamlai closed 5 years ago

TomashKhamlai commented 5 years ago

Preconditions (*)

  1. Self-registered customer without address
  2. Simple product with weight and salable quantity

Steps to reproduce (*)

  1. Generate Customer Token
  2. Create an empty cart for the customer by including token into authorization headers.
  3. Add simple product to the customer's cart
  4. Set shipping address
    mutation {
    setShippingAddressesOnCart(
    input: {
      cart_id: "FD9YMAaXJlHbX4bjEkHiZ3RAsMSbg6fv"
      shipping_addresses: {
        address: {
          firstname: "John"
          lastname: "Doubledo"
          street: "6161 West Centinela Avenue"
          telephone: "+15555555555"
          country_code: "us"
          save_in_address_book: true
          city: "Culver city"
        }
      }
    }
    ) {
    cart {
      email
      shipping_addresses {
        postcode
        firstname
        lastname
        telephone
        selected_shipping_method {
          carrier_code
          method_code
        }
        available_shipping_methods {
          carrier_code
          method_code
        }
      }
    }
    }
    }
  5. Get cart_id for the existing cart
    mutation{
    createEmptyCart
    }

Expected result (*)

  1. Error on step 4 or no errors at all
  2. ShippingAddressInput.postcode is required in schema or validation works in time.

Actual result (*)

  1. Error
    {
    "errors": [
    {
      "debugMessage": "\"postcode\" is required. Enter and try again.",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createEmptyCart"
      ]
    }
    ],
    "data": {
    "createEmptyCart": null
    }
    }
kisroman commented 5 years ago

Can not reproduce this issue by provided steps. I see that my shipping address hasn't postcode(it is null), but

mutation{
  createEmptyCart
}

works for me. It returns old cart id.

kisroman commented 5 years ago

Reproduced after communication.

TomashKhamlai commented 5 years ago

@kisroman, after rechecking this ticket today I see that the issue was fixed by somebody. I am closing this issue. Please reopen if you are still able to reproduce it.

Cc: @lenaorobei