-
Notifications
You must be signed in to change notification settings - Fork 152
Wishlist Update schemas with UID changes #454
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,52 @@ | ||
type Mutation { | ||
createWishlist(name: String!): ID # Multiple wishlists Commerce functionality | ||
removeWishlist(id: ID!): Boolean # Commerce fucntionality - in Opens Source we assume customer always has one wishlist | ||
addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput | ||
removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput | ||
updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput | ||
createWishlist(input: CreateWishlistInput!): CreateWishlistOutput # Multiple wishlists Commerce functionality | ||
deleteWishlist(wishlistUid: ID!): DeleteWishlistOutput # Commerce fucntionality - in Opens Source we assume customer always has one wishlist | ||
addProductsToWishlist(wishlistUid: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput | ||
removeProductsFromWishlist(wishlistUid: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput | ||
updateProductsInWishlist(wishlistUid: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput | ||
copyProductsBetweenWishlists(sourceWishlistUid: ID!, destinationWishlistUid: ID!, wishlistItems: [WishlistItemCopyInput!]!): CopyProductsBetweenWishlistsOutput @doc(description: "Copy a product to the wish list") | ||
moveProductsBetweenWishlists(sourceWishlistUid: ID!, destinationWishlistUid: ID!, wishlistItems: [WishlistItemMoveInput!]!): MoveProductsBetweenWishlistsOutput @doc(description: "Move products from one wish list to another") | ||
updateWishlist( wishlistUid: ID!, input: UpdateWishlistInput!): UpdateWishlistOutput @doc(description: "Change the name and visibility of the specified wish list") | ||
addWishlistItemsToCart( | ||
wishlistUid: ID!, @doc(description: "unique Id of wishlist") | ||
wishlistItemUids: [ID!] @doc(description: "Optional param. selected wish list items that are to be added") | ||
): AddWishlistItemsToCartOutput @doc(description: "Add Requisition List Items To Customer Cart") | ||
} | ||
|
||
type Customer { | ||
wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2") | ||
wishlist_v2(id: ID!): Wishlist # This query will be added in the ce | ||
wishlist_v2(uid: ID!): Wishlist # This query will be added in the ce | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should just deprecate wishlist field and use new field wishlists, which will always have one item in Open Source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @melnikovi I see, you have updated the schema file, Is there a need to do any additional changes to the schema file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what he means here is we should either add wishlist_v3 wishlist_v2(id: ID, uid: ID) - in the code we will make at least 1 that's required but not through schema |
||
wishlists: [Wishlist!]! @doc(description: "Customer wishlists are limited to a max of 1 wishlist in Magento Open Source") # This query will be added in the ce | ||
} | ||
|
||
type Wishlist { | ||
id: ID | ||
items: [WishlistItem] @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead") | ||
items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist") @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead") | ||
items_v3( | ||
currentPage: Int = 1 @doc(description: "current page of the customer wishlist items. default is 1") | ||
pageSize: Int = 20 @doc(description: "page size for the customer wishlist items. default is 20") | ||
): WishlistItems! @doc(description: "An array of items in the customer's wishlist") | ||
uid: ID | ||
items: [WishlistItem] @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") | ||
items_v2( | ||
currentPage: Int = 1, | ||
pageSize: Int = 20 | ||
): WishlistItems @doc(description: "An array of items in the customer's wishlist") | ||
items_count: Int | ||
sharing_code: String | ||
updated_at: String | ||
name: String @doc(description: "Avaialble in Commerce edition only") | ||
visibility: WishlistVisibilityEnum! | ||
} | ||
|
||
type WishlistItems { | ||
items: [WishlistItemInterface]! @doc(description: "Wishlist items list") | ||
page_info: SearchResultPageInfo | ||
total_pages: Int! @doc(description: "total count of wishlist items") | ||
} | ||
|
||
input CreateWishlistInput { | ||
name: String! | ||
visibility: WishlistVisibilityEnum! | ||
} | ||
|
||
input UpdateWishlistInput { | ||
name: String | ||
visibility: WishlistVisibilityEnum | ||
} | ||
|
||
type WishlistItems { | ||
|
@@ -33,8 +56,9 @@ type WishlistItems { | |
} | ||
|
||
input WishlistItemUpdateInput { | ||
wishlist_item_id: ID | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can't remove any of the existing fields, but deprecate them and also add wishlist_item_uid |
||
wishlist_item_uid: ID! | ||
quantity: Float | ||
description: String | ||
selected_options: [ID!] | ||
entered_options: [EnteredOptionInput!] | ||
} | ||
|
@@ -44,24 +68,41 @@ type AddProductsToWishlistOutput { | |
} | ||
|
||
type RemoveProductsFromWishlistOutput { | ||
status: Boolean! | ||
wishlist: Wishlist! | ||
} | ||
|
||
type UpdateProductsInWishlistOutput { | ||
wishlist: Wishlist! | ||
} | ||
|
||
type AddWishlistItemsToCartOutput { | ||
status: Boolean! | ||
add_wishlist_items_to_cart_user_errors: [AddWishlistItemUserError]! | ||
} | ||
|
||
type AddWishlistItemUserError { | ||
message: String! | ||
type: AddWishlistItemUserErrorType! | ||
} | ||
|
||
enum AddWishlistItemUserErrorType { | ||
OUT_OF_STOCK | ||
MAX_QTY_FOR_USER | ||
NOT_AVAILABLE | ||
} | ||
|
||
input WishlistItemInput { | ||
sku: String | ||
quantity: Float | ||
sku: String! | ||
quantity: Float! | ||
parent_sku: String, | ||
parent_quantity: Float, | ||
selected_options: [ID!] | ||
entered_options: [EnteredOptionInput!] | ||
} | ||
|
||
interface WishlistItemInterface { | ||
id: ID | ||
uid: ID | ||
quantity: Float | ||
description: String | ||
added_at: String | ||
|
@@ -90,10 +131,62 @@ type BundleWishlistItem implements WishlistItemInterface { | |
} | ||
|
||
type GiftCardWishlistItem implements WishlistItemInterface { | ||
sender_name: String! | ||
sender_email: String! | ||
gift_card_options: GiftCardOptions! | ||
} | ||
|
||
type GiftCardOptions { | ||
sender_name: String | ||
sender_email: String | ||
recipient_name: String | ||
recipient_email: String | ||
amount: SelectedGiftCardAmount | ||
amount: Money | ||
custom_giftcard_amount: Money | ||
message: String | ||
} | ||
|
||
type GroupedProductWishlistItem implements WishlistItemInterface { | ||
grouped_products: [GroupedProductItem!]! | ||
} | ||
|
||
enum WishlistVisibilityEnum @doc(description: "This enumeration defines the wish list visibility types") { | ||
PUBLIC | ||
PRIVATE | ||
} | ||
|
||
type CreateWishlistOutput { | ||
wishlist: Wishlist! | ||
} | ||
|
||
type DeleteWishlistOutput { | ||
status: Boolean! | ||
wishlists: [Wishlist!]! | ||
} | ||
|
||
input WishlistItemCopyInput { | ||
wishlist_item_uid: ID! @doc(description: "The ID of the item to be copied") | ||
quantity: Float @doc(description: "The quantity of this item to copy to the destination wish list. This value can't be greater than the quantity in the source wish list.") | ||
} | ||
|
||
input WishlistItemMoveInput { | ||
wishlist_item_uid: ID! @doc(description: "The ID of the item to be moved") | ||
quantity: Float @doc(description: "The quantity of this item to move to the destination wish list. This value can't be greater than the quantity in the source wish list.") | ||
} | ||
|
||
type UpdateWishlistOutput { | ||
wishlist: Wishlist | ||
} | ||
|
||
type CopyProductsBetweenWishlistsOutput { | ||
source_wishlist: Wishlist! | ||
destination_wishlist: Wishlist! | ||
} | ||
|
||
type MoveProductsBetweenWishlistsOutput { | ||
source_wishlist: Wishlist! | ||
destination_wishlist: Wishlist! | ||
} | ||
|
||
type StoreConfig { | ||
maximum_number_of_wishlists: Int @doc(description: "If multiple wish lists are enabled, the maximum number of wish lists the customer can have") | ||
enable_multiple_wishlists: Boolean @doc(description: "Indicates whether customers can have multiple wish lists.") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type Customer { | ||
gift_registry_list: [GiftRegistry] | ||
gift_registry(id: ID!): GiftRegistry | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we already took care of gift registy. please remove this scope from your PR |
||
gift_registry(uid: ID!): GiftRegistry | ||
} | ||
|
||
type Query { | ||
|
@@ -11,15 +11,15 @@ type Query { | |
giftRegistryTypeId: ID, | ||
searchableDynamicAttributes: [GiftRegistryDynamicAttributeInput] @doc(description: "For select attributes ID should be provided expected. For range search, '_from' and '_to' suffixes can be added to the attribute code. For text attributes provide value for exact matching.") | ||
): [GiftRegistry] @doc(description: "Gift registry search by registrant name and additional searchable attributes.") | ||
giftRegistry(id: ID!): GiftRegistry @doc(description: "This query is intended for guests and some fields of GiftRegistry will not be availalbe") | ||
giftRegistry(uid: ID!): GiftRegistry @doc(description: "This query is intended for guests and some fields of GiftRegistry will not be availalbe") | ||
} | ||
|
||
type Mutation { | ||
# All mutations below should only be accessible to the registry owner. Guest users should be getting authorization error | ||
|
||
createGiftRegistry(giftRegistry: CreateGiftRegistryInput!): CreateGiftRegistryOutput | ||
updateGiftRegistry(id: ID!, giftRegistry: UpdateGiftRegistryInput!): UpdateGiftRegistryOutput | ||
removeGiftRegistry(id: ID!): RemoveGiftRegistryOutput | ||
updateGiftRegistry(uid: ID!, giftRegistry: UpdateGiftRegistryInput!): UpdateGiftRegistryOutput | ||
removeGiftRegistry(uid: ID!): RemoveGiftRegistryOutput | ||
|
||
addGiftRegistryItems(giftRegistryId: ID!, items: [AddGiftRegistryItemInput!]!): AddGiftRegistryItemsOutput | ||
removeGiftRegistryItems(giftRegistryId: ID!, itemIds: [ID!]!): RemoveGiftRegistryItemsOutput | ||
|
@@ -29,7 +29,7 @@ type Mutation { | |
updateGiftRegistryRegistrants(giftRegistryId: ID!, registrants: [UpdateGiftRegistryRegistrantInput!]!): UpdateGiftRegistryRegistrantsOutput | ||
removeGiftRegistryRegistrants(giftRegistryId: ID!, registrantIds: [ID!]!): RemoveGiftRegistryRegistrantsOutput | ||
|
||
shareGiftRegistry(id: ID!, sender: ShareGiftRegistrySenderInput!, invitees: [ShareGiftRegistryInviteeInput!]!): ShareGiftRegistryOutput | ||
shareGiftRegistry(uid: ID!, sender: ShareGiftRegistrySenderInput!, invitees: [ShareGiftRegistryInviteeInput!]!): ShareGiftRegistryOutput | ||
} | ||
|
||
input ShareGiftRegistryInviteeInput | ||
|
@@ -58,12 +58,12 @@ input AddGiftRegistryItemInput { | |
|
||
# Should be defined in scope of https://github.com/magento/architecture/blob/master/design-documents/graph-ql/coverage/add-items-to-cart-single-mutation.md | ||
input EnteredOptionInput { | ||
id: String! | ||
uid: String! | ||
value: String! | ||
} | ||
|
||
input UpdateGiftRegistryItemInput { | ||
id: ID! | ||
uid: ID! | ||
quantity: Float! | ||
note: String | ||
} | ||
|
@@ -79,7 +79,7 @@ input UpdateGiftRegistryInput { | |
} | ||
|
||
input CreateGiftRegistryInput { | ||
id: ID @doc(description: "Optional id, can be generated on the client and used for sending multiple gift-registry related mutations in a single request. For example, create registry and immediatly add items or registrants.") | ||
uid: ID @doc(description: "Optional id, can be generated on the client and used for sending multiple gift-registry related mutations in a single request. For example, create registry and immediatly add items or registrants.") | ||
event_name: String! | ||
type_id: String! | ||
message: String! | ||
|
@@ -95,7 +95,7 @@ input GiftRegistryShippingAddressInput @doc(description: "Either address data or | |
} | ||
|
||
input UpdateGiftRegistryRegistrantInput { | ||
id: ID! | ||
uid: ID! | ||
first_name: String | ||
last_name: String | ||
email: String | ||
|
@@ -155,7 +155,7 @@ type ShareGiftRegistryOutput { | |
} | ||
|
||
type GiftRegistryType { | ||
id: ID! | ||
uid: ID! | ||
label: String! | ||
dynamic_attributes_metadata: [GiftRegistryDynamicAttributeMetadataInterface] | ||
} | ||
|
@@ -224,7 +224,7 @@ type GiftRegistrySelectAttributeOptionMetadata { | |
} | ||
|
||
type GiftRegistry { | ||
id: ID! | ||
uid: ID! | ||
event_name: String! | ||
type: GiftRegistryType | ||
message: String! | ||
|
@@ -239,7 +239,7 @@ type GiftRegistry { | |
} | ||
|
||
interface GiftRegistryItemInterface { | ||
id: String! | ||
uid: String! | ||
quantity: Float! | ||
quantity_fulfilled: Float! | ||
note: String | ||
|
@@ -301,7 +301,7 @@ enum GiftRegistryDynamicAttributeGroup { | |
} | ||
|
||
type GiftRegistryRegistrant { | ||
id: ID! | ||
uid: ID! | ||
first_name: String! | ||
last_name: String! | ||
email: String! @doc(description: "Accessible to the registry owner only") | ||
|
Uh oh!
There was an error while loading. Please reload this page.