Open ioweb-gr opened 1 year ago
Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. @magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering Admin access: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering/admin_3e53 Login: a2710bae Password: ab32c20a954a
Hi @ioweb-gr,
Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.
As per Magento devdocs The wishlist query has been deprecated. Wish list information is now provided by the customer query.
We have used customer query for wishlists.
{
customer {
wishlists {
id
name
items_count
items_v2 {
items {
id
product {
uid
name
sku
}
}
}
}
}
}
When we have no products in wishlists we got below response
When we have products in wishlists we got below response.
Kindly recheck the behavior on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.
Please let us know if we missed anything.
Thanks.
@engcom-Bravo however, the deprecated endpoint still exists on 2.4-develop it's not entirely removed. And the issue is reproduced perfectly fine on 2.4.5-p1 with the original endpoint.
Do you mean because it was deprecated it is ok if it's broken?
If that's the case then imho it should be removed entirely so that users will know it's not there any more as while it's there even as deprecated, people can use it.
So in any case this issue is still valid as in: either the endpoint should be removed, or it should be fixed. Don't you agree?
@magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering Admin access: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering/admin_f757 Login: 584c79dd Password: bb4e45eab043
Hi @ioweb-gr,
Thanks for your update.
Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.
We have used below query
query {
wishlist {
items {
added_at
description
id
product {
name
image {
url
}
sku
}
qty
}
items_count
sharing_code
}
}
We are not getting any error.
Kindly recheck the behavior on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.
Thanks.
@magento give me 2.4.5-p1 instance
Hi @ioweb-gr. Thank you for your request. I'm working on Magento instance for you.
Hi @ioweb-gr, here is your Magento Instance: https://b38ffd4dd119588a2d13e9dd9bbeedbc.instances.magento-community.engineering Admin access: https://b38ffd4dd119588a2d13e9dd9bbeedbc.instances.magento-community.engineering/admin_4b6c Login: c7fd2fa8 Password: cf06bb40e894
2.4.5-p1 instance has an exception
@magento give me 2.4.5 instance
Hi @ioweb-gr. Thank you for your request. I'm working on Magento instance for you.
Hi @ioweb-gr, here is your Magento Instance: https://7cafa623bd2808f1da0792c4956d36d5.instances.magento-community.engineering Admin access: https://7cafa623bd2808f1da0792c4956d36d5.instances.magento-community.engineering/admin_c14a Login: 219c2650 Password: e7770b93d40a
@magento give me 2.4-develop instance
Hi @ioweb-gr. Thank you for your request. I'm working on Magento instance for you.
Hi @ioweb-gr, here is your Magento Instance: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering Admin access: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering/admin_b1c5 Login: bf34dfc9 Password: 36cd9192c1a2
@magento give me 2.4.5 instance
Hi @ioweb-gr. Thank you for your request. I'm working on Magento instance for you.
Hi @ioweb-gr, here is your Magento Instance: https://7cafa623bd2808f1da0792c4956d36d5.instances.magento-community.engineering Admin access: https://7cafa623bd2808f1da0792c4956d36d5.instances.magento-community.engineering/admin_f7c9 Login: f9ab1081 Password: 2989cbcf4c7d
OK @engcom-Bravo I've tested it online and it seems it's not working on the automated instance
Hi @ioweb-gr, here is your Magento Instance: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering Admin access: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering/admin_b1c5 Login: bf34dfc9 Password: 36cd9192c1a2
So this was a 2.4 develop instance
I'm issuing these graphql queries in succession
mutation {
createCustomer(
input: {
firstname: "John"
lastname: "Doe"
email: "test1@example.com"
password: "Test1234"
is_subscribed: true
}
) {
customer {
firstname
lastname
email
is_subscribed
}
}
}
{
"data": {
"createCustomer": {
"customer": {
"firstname": "John",
"lastname": "Doe",
"email": "test1@example.com",
"is_subscribed": true
}
}
}
}
mutation {
generateCustomerToken(email: "test1@example.com", password: "Test1234") {
token
}
}
{
"data": {
"generateCustomerToken": {
"token": "eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjMsInV0eXBpZCI6MywiaWF0IjoxNjc3NTAxMTA1LCJleHAiOjE2Nzc1MDQ3MDV9.WnmsaodV62pQR--Tf-PKbgkVZsjmVA1IhmSWpX_K5ow"
}
}
}
query {
wishlist {
items {
added_at
description
id
product {
name
image {
url
}
sku
}
qty
}
items_count
sharing_code
}
}
{
"errors": [
{
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"wishlist",
"items"
]
}
],
"data": {
"wishlist": {
"items": null,
"items_count": null,
"sharing_code": null
}
}
}
The difference must be that you registered through the website so a wishlist was automatically created maybe?
I managed to create a workaround by using a plugin
<?php
/*
* Copyright (c) 2023. IOWEB TECHNOLOGIES
*/
namespace Ioweb\GraphQlExtend\Plugin\Model\Resolver;
use Magento\Wishlist\Model\ResourceModel\Wishlist as WishlistResourceModel;
use Magento\Wishlist\Model\WishlistFactory;
use Magento\WishlistGraphQl\Model\Resolver\WishlistResolver;
class WishlistResolverPlugin
{
/**
* @var WishlistFactory
*/
private $wishlistFactory;
/**
* @param WishlistFactory $wishlistFactory
*/
public function __construct(WishlistResourceModel $wishlistResource, WishlistFactory $wishlistFactory)
{
$this->wishlistFactory = $wishlistFactory;
}
public function afterResolve(WishlistResolver $subject, $result)
{
if(empty($result)){
$wishlist = $this->wishlistFactory->create();
$result['model'] = $wishlist;
}
return $result;
}
}
It seems just returning an empty array is not enough in the resolver. It requires to have a model defined even if it's an empty wishlist model to return something otherwise it throws exception
Hi @ioweb-gr,
Thanks for your update.
We have followed these steps https://github.com/magento/magento2/issues/36909#issuecomment-1446253797.Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.
After creating a customer using mutation we need to login with that credentials.Kindly refer this document https://developer.adobe.com/commerce/webapi/graphql/tutorials/checkout/create-customer/
Kindly check after sign in with that customer.Please let us know if you are still facing any issue.
Thanks.
After creating a customer using mutation we need to login with that credentials.Kindly refer this document https://developer.adobe.com/commerce/webapi/graphql/tutorials/checkout/create-customer/
I think you miss the point.
On step 2 I wrote specifically I use this request to login.
mutation {
generateCustomerToken(email: "test1@example.com", password: "Test1234") {
token
}
}
I get this token from the response
{
"data": {
"generateCustomerToken": {
"token": "eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjMsInV0eXBpZCI6MywiaWF0IjoxNjc3NTA3OTA4LCJleHAiOjE2Nzc1MTE1MDh9.aekNr2z4zCtbbyAuORi1uN5f4X4c3HKQlcXEG72KktA"
}
}
}
And then in the next request
query {
wishlist {
items {
added_at
description
id
product {
name
image {
url
}
sku
}
qty
}
items_count
sharing_code
}
}
I use the token above as bearer token and execute and receive this error.
This is all on your instance
https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering/graphql
Here take a postman collection and try it again with your own new customer with a new username / password set.
It always replicates if you don't go to the website and login
Keep in mind there's no frontend to login to because we're using magento only via graphql
magento2sandbox.postman_collection.zip
{
"errors": [
{
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"wishlist",
"items"
]
}
],
"data": {
"wishlist": {
"items": null,
"items_count": null,
"sharing_code": null
}
}
}
@magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering Admin access: https://fcb6c12ab32b4dfbb356a20bf9edd981.instances.magento-community.engineering/admin_9d35 Login: c3efa371 Password: e9a4b6a036ce
Hi @ioweb-gr,
Thanks for your update.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Create Customer
Generate Customer Token
Wishlist query using the above token
We are getting Internal server error
.
Hence confirming this issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-8062 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Thank you for verifying @engcom-Bravo :) Hopefully it will be solved. I wonder if the same issue happens on the customerCart endpoint now that you mentioned. You tested it but could you verify for me if you logged in first to your dashboard before running the customerCart query for the wishlist?
@magento I am working on this
Preconditions and environment
Steps to reproduce
Get a graphQL token
Query wishlist
Expected result
Actual result
Additional information
This seems to be in vendor/magento/module-wishlist-graph-ql/Model/Resolver/WishlistResolver.php:63 where it returns an empty array, but instead it expects to have a model set for each item even with an empty array.
Release note
No response
Triage and priority