Skip to content

GraphQL customer.compare_list returns null even when customer has items in compare list #39874

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

Open
2 of 5 tasks
lintots opened this issue Apr 29, 2025 · 5 comments
Open
2 of 5 tasks
Assignees
Labels
feature request Progress: ready for grooming Reported on 2.4.7-p3 Indicates original Magento version for the Issue report.

Comments

@lintots
Copy link

lintots commented Apr 29, 2025

Preconditions and environment

The compare_list field under the customer query in GraphQL always returns null for logged-in users, even when the customer has added items to the compare list on the storefront.

  • Magento version: 2.4.7-p3
  • PHP version: 8.1
  • GraphQL module: Magento_CatalogGraphQl is enabled
  • A customer account exists and is logged in using a valid customer token
  • The customer has added at least one product to the Compare Products list on the storefront

Steps to reproduce

  • Log in as a customer on the storefront.
  • Add products to the compare list.
  • Use this GraphQL query with the customer's auth token:
    {
    customer {
    compare_list {
    items {
    product {
    id
    name
    sku
    }
    }
    }
    }
    }

Expected result

Should return the compare list items for the logged-in customer.

Actual result

{
"data": {
"customer": {
"compare_list": null
}
}
}

Additional information

This affects mobile and PWA implementations where a consistent compare list experience is expected across web and app.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Apr 29, 2025

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


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 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.

Copy link

m2-assistant bot commented Apr 29, 2025

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p3 Indicates original Magento version for the Issue report. label Apr 29, 2025
@engcom-Bravo
Copy link
Contributor

Hi @lintots,

Thanks for your reporting and collaboration.

We have tried to reproduce the issue in Latest 2.4-develop instance and we are not able to reproduce the issue.kindly refer the screenshots.

Image

It is returning the compare list items for the logged-in customer.

https://developer.adobe.com/commerce/webapi/graphql/schema/products/queries/compare-list/ could you please refer this document regarding compare list and please let us know if we are facing any issye.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Apr 29, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Apr 29, 2025
@lintots
Copy link
Author

lintots commented Apr 29, 2025

Thank you for your response.

The issue is not with fetching the uid when querying a particular compare list using the compareList(uid: ...) query. This works as expected. The problem arises when we try to access the customer's actual compare list — we are unable to get the uid in that case, which is essential for subsequent queries.

To clarify our scenario is:

A logged-in customer creates a compare list on the web. Later, they log into the mobile app and want to view or add more products to the same list. However, to fetch that list in the app, we need the compare list’s UID. The issue is that there's no way to retrieve the UID directly for the logged-in customer's list, which prevents accessing or updating it across platforms.

The problem occurs when trying to retrieve the customer’s compare list (not a specific one), and the result is null instead of the expected compare list data.

The issue arises because we need the uid of the customer’s compare list to proceed with further operations, but we cannot access it through the current GraphQL query. This leads to the null response.

@engcom-Bravo
Copy link
Contributor

Hi @lintots,

Thanks for your Update.

Currently we must specify the unique ID of the comparison list and as per this comment #39874 (comment) it seems to be an enhancement to proceed further marking this Feature Request.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Progress: ready for grooming Reported on 2.4.7-p3 Indicates original Magento version for the Issue report.
Projects
Status: Ready for Grooming
Development

No branches or pull requests

2 participants