Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@daksamit
Copy link

@daksamit 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

This comment has been minimized.

Copy link

@m2-assistant 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
@m2-community-project m2-community-project bot added this to Ready for Grooming in Backlog Nov 1, 2019
@TomashKhamlai

This comment has been minimized.

Copy link
Collaborator

@TomashKhamlai TomashKhamlai commented Nov 1, 2019

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

This comment has been minimized.

Copy link
Collaborator

@TomashKhamlai TomashKhamlai commented Nov 1, 2019

@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.

@sdzhepa sdzhepa removed this from Ready for QA in Community Backlog Nov 4, 2019
@lenaorobei lenaorobei moved this from Ready for Grooming to Pull Request In Progress in Backlog Nov 4, 2019
@lenaorobei lenaorobei moved this from Pull Request In Progress to Done in Backlog Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Backlog
  
Done
2 participants
You can’t perform that action at this time.