Closed janssentwh closed 5 years ago
@janssentwh, thank you for your contribution. I would like to ask you to merge the latest changes from the mainline. PR#804 was merged yesterday and it is very important for us to test your code with the latest changes in 2.3-develop.
Today I had some trouble with this PR. Please try these steps and tell me if you are able to reproduce them.
Add product to cart (GraphQL)
mutation {
addSimpleProductsToCart(
input: {
cart_id: "12345678901234567890123456789012"
cart_items: {
data: {
quantity: 1
sku: "simple-product-1"
}
customizable_options: [
{
id: 3
value_string: "01-01-01 14:00:05"
}
{
id: 1
value_string: "01-01-01 14:00:05"
}
{
id: 2
value_string: "01-01-01 14:00:05"
}
]
}
}
) {
cart {
items {
id
quantity
product {
sku
stock_status
}
... on SimpleCartItem {
customizable_options {
id
label
values {
id
label
value
}
}
}
}
}
}
}
{
"errors": [
{
"debugMessage": "Cannot return null for non-nullable field SelectedCustomizableOptionValue.value.",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 18,
"column": 15
}
],
"path": [
"addSimpleProductsToCart",
"cart",
"items",
0,
"customizable_options",
1,
"values",
0,
"value"
]
}
],
"data": {
"addSimpleProductsToCart": {
"cart": {
"items": [
{
"id": "5",
"quantity": 1,
"product": {
"sku": "simple-product-1",
"stock_status": "IN_STOCK"
},
"customizable_options": [
{
"id": 1,
"label": "d1",
"values": [
{
"id": 19,
"label": "",
"value": "Jan 1, 2001"
}
]
},
{
"id": 2,
"label": "d2",
"values": [
null
]
},
{
"id": 3,
"label": "d3",
"values": [
{
"id": 21,
"label": "",
"value": "2:00 AM"
}
]
}
]
}
]
}
}
}
}
And please write some api-functional tests.
Closing this PR due to inactivity. Please feel free to reopen if you would like to continue working on it. Thanks.
Hi @janssentwh, thank you for your contribution! Please, complete Contribution Survey, it will take less than a minute. Your feedback will help us to improve contribution process.
As the date and time type customizable options still return an error in graphQL I have limited the scope of this solution to the sole purpose of returning the original date_time value.
Description (*)
As the date and time type customizable options still return an error in graphQL I have limited the scope of this solution to the sole purpose of returning the original date_time value.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
I have not had the feeling this was the correct location of solving the problem as the Resolver might not to be concerned with the format of the output. I would like some feedback on this solution.
Contribution checklist (*)