Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Misleading country_code field and missing vat_id in graphql mutation schema #1045

Closed
daksamit opened this issue Nov 1, 2019 · 3 comments
Closed

Comments

@daksamit
Copy link

daksamit commented Nov 1, 2019

Preconditions (*)

  1. Magento 2.3.3

Steps to reproduce (*)

  1. Using setBillingAddressOnCart mutation, tax_id field can't be set. There is no such type in graphQL schema. Tested with fresh magento 2 and graphiQL chrome extension.
  2. Misleading field name for shippingAddress and billingAddress. REST API requires country_id, whereas GraphQL has country_code.

Expected result (*)

  1. Should set tax_id for address properly
  2. For both implementation should be consistent naming convention for that field.

Actual result (*)

{
  "errors": [
    {
      "message": "Field \"tax_id\" is not defined by type CartAddressInput.",
      "category": "graphql",
      "locations": [
        {
          "line": 66,
          "column": 11
        }
      ]
    }
  ]
}
@m2-assistant
Copy link

m2-assistant bot commented Nov 1, 2019

Hi @daksamit. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@daksamit do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@TomashKhamlai TomashKhamlai transferred this issue from magento/magento2 Nov 1, 2019
@TomashKhamlai
Copy link
Contributor

It is expected behavior. You can set tax_id for the customer. It will be included in the billing data. You can't do manipulations with tax_id during checkout.

app/code/Magento/CustomerGraphQl/etc/schema.graphqls

input CustomerAddressInput {
    firstname: String @doc(description: "The first name of the person associated with the shipping/billing address")
    lastname: String @doc(description: "The family name of the person associated with the shipping/billing address")
    company: String @doc(description: "The customer's company")
    telephone: String @doc(description: "The telephone number")
    street: [String] @doc(description: "An array of strings that define the street number and name")
    city: String @doc(description: "The city or town")
    region: CustomerAddressRegionInput @doc(description: "An object containing the region name, region code, and region ID")
    postcode: String @doc(description: "The customer's ZIP or postal code")
    country_id: CountryCodeEnum @doc(description: "Deprecated: use `country_code` instead.")
    country_code: CountryCodeEnum @doc(description: "The customer's country")
    default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address")
    default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address")
    fax: String @doc(description: "The fax number")
    middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address")
    prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
    suffix: String @doc(description: "A value such as Sr., Jr., or III")
    vat_id: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")
    custom_attributes: [CustomerAddressAttributeInput] @doc(description: "Deprecated: Custom attributes should not be put into container.")
}

@TomashKhamlai
Copy link
Contributor

@daksamit the second problem is already ✔️ FIXED by #958 and good chances that this fix will be present in the upcoming 2.3.4 release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants