Skip to content

Wishlist updates proposed in Magento 2 Commerce PR (internal) #403

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

Merged
merged 2 commits into from
Jul 22, 2020

Conversation

DrewML
Copy link
Contributor

@DrewML DrewML commented Jul 16, 2020

Based on issue discovered in https://github.com/magento/partners-magento2ee/pull/248.

There is a separate PR with some of the work.

Proposal was approved by @nrkapoor and @fnhipster, but sending through the proper channels for review.

wishlists: [Wishlist!]! @doc(description: "Customer multiple wishlists") # Multiple wishlists Commerce functionality
wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlistByID")
wishlistByID(id: ID!): Wishlist
wishlists: [Wishlist!]! @doc(description: "Customer wishlists are limited to a max of 1 wishlist in Magento Open Source")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can also be limited to one in Commerce, with the Enable Multiple Wish Lists feature set to false

https://docs.magento.com/user-guide/configuration/customers/wishlist.html#general-options

wishlist: Wishlist! @doc(description: "Customer wishlist") # Commerce will extend filed with required `id` argument `wishlists(ids: ID!)`
wishlists: [Wishlist!]! @doc(description: "Customer multiple wishlists") # Multiple wishlists Commerce functionality
wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlistByID")
wishlistByID(id: ID!): Wishlist
Copy link
Contributor

Choose a reason for hiding this comment

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

How about v2 instead of byId, this would be more aligned with our current strategy.

Suggested change
wishlistByID(id: ID!): Wishlist
wishlist_v2(id: ID!): Wishlist

Copy link
Contributor Author

@DrewML DrewML Jul 21, 2020

Choose a reason for hiding this comment

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

Would like to respectfully question our current strategy a little bit. I'm not sure prepending things with _v2 by default is the best design we can do.

A field name should really describe to the client what the purpose of the field is.

  • wishlistByID(id: ID!) - Makes it clear you're getting a wishlist by ID, but a bit redundant
  • wishlist(id: ID) - Makes it clear you're getting a wishlist by ID
  • wishlist_v2(id: ID!) - Makes it apparent that you're looking up by ID, but also makes you wonder why the v1 version of the field had issues.

I can see _v2 in a scenario where we can't come up with a more descriptive name, but I think we have a variety of naming choices here. Can also be redundant and do customer_wishlist or wishlist_details. Plenty of options!

@nrkapoor mentioned recently that we have rules around how long a deprecation lasts before we're safe to remove a field. So the _v2 will likely live long after the original is gone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spoke with @nishant, and he's in favor of _v2, and I'm in favor of consensus :)

I'll push up changes

@DrewML DrewML merged commit f335eb5 into master Jul 22, 2020
@nishant
Copy link

nishant commented Jul 22, 2020

I believe you mentioned the wrong user as I have no connection to this repository

@DrewML
Copy link
Contributor Author

DrewML commented Jul 22, 2020

Whoops - sorry about that @nishant!

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.

4 participants