Skip to content
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

Add wishlists in products query as a graph #482

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cpartica
Copy link
Contributor

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

@supernova-at
Copy link

Thanks for this!

Yes, https://jira.corp.magento.com/browse/PWA-1268 calls for the following UI:

Screen Shot 2021-03-25 at 11 02 53 AM

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@supernova-at how do you feel about this? we would lean to not expose the whole wishlist type and create a loop

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants