Add wishlists in products query as a graph#482
Add wishlists in products query as a graph#482cpartica wants to merge 5 commits intomagento:masterfrom
Conversation
|
Thanks for this! Yes, https://jira.corp.magento.com/browse/PWA-1268 calls for the following UI: Notice the heart indicators for whether or not a product has already been favorited. This PR will help the storefront know immediately how to display that heart / favorite indicator instead of having to do a bunch of custom client-side logic and additional wishlist lookups. |
| By default a product is not assigned to any wishlist | ||
|
|
||
| ### Considerations of performance versus graphql specs | ||
| The UI really needs this to render a PDP page or Category with products page and list a dropdown of wishlists of which the product is assigned to. |
There was a problem hiding this comment.
@supernova-at how do you feel about this? we would lean to not expose the whole wishlist type and create a loop
There was a problem hiding this comment.
Yes, I'd lean that way too. I suppose I could envision a scenario where the UI would want to show the names of the wishlists that the product belonged to, but I think it's perfectly reasonable to have the front end make an additional query for the full wishlist data.
As long as the minimal type would give us enough information to look up the full wishlist, I think that's fine 👍 .
For example, type gives wishlistID and then there's a way to get wishlists by wishlistID.
Co-authored-by: Andy Terranova <13182778+supernova-at@users.noreply.github.com>

Problem
Products query doesn't contain reference to wishlist, it takes a round trip to render a PDP page dropdown to what wishlists are assgined to the product
Solution
add the reference in schema
Requested Reviewers