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

GraphQL Internal server error during setShippingAddressesOnCart #1066

Closed stijnbernards closed 4 years ago

stijnbernards commented 4 years ago

Preconditions (*)

  1. Magento 2.3.3
  2. No configuration done and no Sample Data

Steps to reproduce (*)

  1. Create a cart via GraphQL
  2. execute the setShippingAddressesOnCart with all information present except the country_code

Expected result (*)

  1. Proper validation response telling us that country is required

Actual result (*)

  1. GraphQL internal server error
atwixfirster commented 4 years ago

@TomashKhamlai , I was unable reproduce this issue on my instance. I got Field CartAddressInput.country_code of required type String! was not provided. error if country_code was not set in the mutation query:

mutation {
  setShippingAddressesOnCart(
    input: {
      cart_id: "hnnNHI6X7a3N6cdbmoeswrF3qewwHQqC"
      shipping_addresses: [
        {
          address: {
            firstname: "John"
            lastname: "Doe"
            company: "Company Name"
            street: ["320 N Crescent Dr", "Beverly Hills"]
            city: "Los Angeles"
            region: "CA"
            postcode: "90210"
            telephone: "123-456-0000"
            save_in_address_book: false
          }
        }
      ]
    }
  ) {
    cart {
      shipping_addresses {
        firstname
        lastname
        company
        street
        city
        region {
          code
          label
        }
        postcode
        telephone
        country {
          code
          label
        }

      }
    }
  }
}
1066