-
Notifications
You must be signed in to change notification settings - Fork 153
graphQl-961: ShippingAddressInput.postcode: String, is not required by Schema #969
graphQl-961: ShippingAddressInput.postcode: String, is not required by Schema #969
Conversation
9d1dce5
to
18a3260
Compare
) { | ||
$this->quoteAddressFactory = $quoteAddressFactory; | ||
$this->getCustomerAddress = $getCustomerAddress; | ||
$this->addressHelper = $addressHelper; | ||
$this->countryInformationAcquirer = $countryInformationAcquirer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not care about BC in GraphQL modules. Only the schema is out API.
https://github.com/magento/graphql-ce/wiki/Approach-to-Implementation#backward-compatibility-policy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php
Outdated
Show resolved
Hide resolved
* @param array $errors | ||
* @return string | ||
*/ | ||
private function getAddressErrors(array $errors): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add also test case with multiple errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address comments.
@TomashKhamlai query you are trying to test has syntax issues.
|
@magento run Functional Tests |
Hi @lenaorobei, thank you for the review.
|
@lenaorobei, I've tried with array syntax also (usually both variants work as expected) Request:mutation {
setShippingAddressesOnCart(
input: {
cart_id: "02GYdVCktyqGo8LfEkoBwPbkCLxt3lL9"
shipping_addresses: [
{
address: {
country_code: "US"
firstname: "John"
lastname: "Doubledo"
telephone: ""
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
}
}
}
}
} Response:{
"errors": [
{
"debugMessage": "Notice: Undefined index: street in /var/www/html/graphqlce/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php on line 93",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"setShippingAddressesOnCart"
]
}
],
"data": {
"setShippingAddressesOnCart": null
}
} |
$addressInput['region_code'] = $addressInput['region']; | ||
} | ||
} | ||
|
||
$maxAllowedLineCount = $this->addressHelper->getStreetLines(); | ||
if (is_array($addressInput['street']) && count($addressInput['street']) > $maxAllowedLineCount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that $addressInput['street']
can be empty and this should be checked here or somewhere else before these lines can be executed.
@magento run Unit Tests |
Created a separate issue #1033 for the case when the street parameter was omitted. |
…ot required by Schema #969
Hi @kisroman, thank you for your contribution! |
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)