From 9a1fd86b0d44b0403308aeb592632dcf07f3f46a Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 2 Sep 2020 19:14:03 -0500 Subject: [PATCH 01/19] Updated GraphQl Compare List Proposal --- .../graph-ql/coverage/catalog/compare-list.md | 60 ++++++++++++++++--- 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index 1307b54cc..c6cc5a925 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -1,11 +1,26 @@ # Use cases -## Guest scenario +## User scenario (Guest/ Logged in) + +Use createCompareList mutation to create a new compare list. The server should create a new list with the items added and return the list_id. The clients can use this list_id for futher operations. + +# Create Compare List +```graphql +{ + mutation { + createCompareList(items: ["100123", "234567", "874321"]) #items optional + } { + list_id + items { + sku + } + } +} +``` +* For a guest user, new list will be created +* For a logged in user, exisiting list_id will be returned (Can be extended in future ee - to support multiple compare list per customer) + -* A buyer can create a new compare list for the selected -products by calling mutation `addItemsToCompareList` with -the list of product ids and ID which will identify the list. -Compare list ID is client generated identifier. ```graphql { mutation { @@ -18,7 +33,7 @@ Compare list ID is client generated identifier. { query { customer { - compare_list { + compare_list(id) { # id filter is optional. Will return an array of compare lists (Future extensibility) list_id items { sku @@ -29,10 +44,11 @@ Compare list ID is client generated identifier. } ``` * If the registered customer does not have an active list then null will be returned. -This means the client has to generate and send a new ID if the compare list functionality requested. -* If the buyer calls addItemsToCompareList with a new ID the previous list will be abandoned. -For the registered user an active compare list will be replaced with a new one. +``` +assignCompareListToCustomer(customerId: ID!, listId: ID!): CompareList +``` +mutation can be used to assign a guest compare list to a registered customer. * A buyer can modify the existing list by calling mutation: * `addItemsToCompareList` to add new items to compare list. @@ -74,6 +90,10 @@ preconfigured at the backoffice. * Compare list could be assigned to the registered customer after login or account creation. +## Removing stale comparison list +* Introduce a mutation to removeComparisonList(id: ID!): Boolean, which clients can use to remove the list once the session expires +* A cron job + ![compare-list.graphqls](compare-list/compare-list.png) # Non functional requirements: @@ -83,3 +103,25 @@ preconfigured at the backoffice. Guest compare list business logic not implemented yet. Additional development required. +## Current limitations + +Existing table structure for compare list +``` +catalog_compare_item +------------------------------------------------------------------------------ +| catalog_compare_item_id | visitor_id | customer_id | product_id | store_id | +============================================================================== +``` +The visitor_id (non nullable) is tied to session \Magento\Customer\Model\Visitor in Luma. GraphQl layer should not be tied to Luma's session. So Compare-lists via GraphQl will have to differ/deviate from Luma. + +This dependency can be solved by managing the compare list state in a new table +``` +catalog_compare_list +------------------------------------------------------------------------------ +| entity_id (int) (primary)| masked_id (varchar)(indexed) | customer_id (int) (nullable)(indexed)| product_ids (json) (non nullable)| store_id (int) (non nullable)| last_modfied (date) +============================================================================== +``` +* On first client request, a row will be populated with an entity_id, server generated masked_id, customer_id (? if logged in), product_id and store_id. +* masked_id will be used for client communications +* product_ids is a json field for reducing storage complexity. +* introducing entity_id for the list will enable customers to have more than one compare list (future extensibility) From d5bac1414bf217a13cdb0bca3cc2f63d7e546621 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 2 Sep 2020 19:32:33 -0500 Subject: [PATCH 02/19] minor fix. --- design-documents/graph-ql/coverage/catalog/compare-list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index c6cc5a925..d6fcfeb02 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -92,7 +92,7 @@ preconfigured at the backoffice. ## Removing stale comparison list * Introduce a mutation to removeComparisonList(id: ID!): Boolean, which clients can use to remove the list once the session expires -* A cron job +* A cron job to remove staled entries beyond certain time. ![compare-list.graphqls](compare-list/compare-list.png) From d3d26425873fc9ea63c19c583d0eb863629d58d8 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 3 Sep 2020 10:54:19 -0500 Subject: [PATCH 03/19] Removing the additional id field, based on Anton's suggestion. --- design-documents/graph-ql/coverage/catalog/compare-list.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index d6fcfeb02..ac9bd6ed4 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -118,10 +118,10 @@ This dependency can be solved by managing the compare list state in a new table ``` catalog_compare_list ------------------------------------------------------------------------------ -| entity_id (int) (primary)| masked_id (varchar)(indexed) | customer_id (int) (nullable)(indexed)| product_ids (json) (non nullable)| store_id (int) (non nullable)| last_modfied (date) +| entity_id (int) (primary)| customer_id (int) (nullable)(indexed)| product_ids (json) (non nullable)| store_id (int) (non nullable)| last_modfied (date) ============================================================================== ``` * On first client request, a row will be populated with an entity_id, server generated masked_id, customer_id (? if logged in), product_id and store_id. -* masked_id will be used for client communications +* encoded entity_id will be used for client communications * product_ids is a json field for reducing storage complexity. * introducing entity_id for the list will enable customers to have more than one compare list (future extensibility) From 45fb01d46ad77fdd67a6a0683fa3a4b71c5dfb42 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 3 Sep 2020 13:47:00 -0500 Subject: [PATCH 04/19] Update compare-list.md --- design-documents/graph-ql/coverage/catalog/compare-list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index ac9bd6ed4..b59a92162 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -118,7 +118,7 @@ This dependency can be solved by managing the compare list state in a new table ``` catalog_compare_list ------------------------------------------------------------------------------ -| entity_id (int) (primary)| customer_id (int) (nullable)(indexed)| product_ids (json) (non nullable)| store_id (int) (non nullable)| last_modfied (date) +| entity_id (int) (primary)| customer_id (int) (nullable)(indexed)| product_ids (json) (non nullable)| store_id (int) (non nullable)| last_modfied (date) | additional_data (json) (nullable) ============================================================================== ``` * On first client request, a row will be populated with an entity_id, server generated masked_id, customer_id (? if logged in), product_id and store_id. From 97fa6b271cd408f44200fa5791feae47e05f874d Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 3 Sep 2020 13:58:33 -0500 Subject: [PATCH 05/19] Reflecting schema changes based on the new proposal. --- .../graph-ql/coverage/catalog/compare-list.graphqls | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index ce856dd26..37371d4ca 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -10,24 +10,25 @@ type ComparableItem { type ComparableAttribute { code: String! @doc(description: "Attribute code ") - title: String! @doc(description: "Addibute display title") + title: String! @doc(description: "Attribute display title") } type CompareList { - list_id: ID! @doc(description: " Compare list id") + list_id: ID! @doc(description: "Compare list id") items: [ComparableItem] @doc(description: "Comparable products") attributes: [ComparableAttribute] @doc(description: "Comparable attributes, provides codes and titles for the attributes") } type Customer { - compare_list: CompareList @doc(description: "Active customers compare list") + compareList(id: ID): [CompareList] @doc(description: "Active customers compare list") #id is optional. Introduces the possibility of more than 1 compare list. } type Query { - compareList(id: ID!): CompareList @doc(description: "Compare list") + compareList(id: ID!): [CompareList] @doc(description: "Compare list") } type Mutation { + createCompareList(items: [ID!]): CompareList @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") addItemsToCompareList( id: ID! items: [ID!] From 2868872075cfec8d0b206a1dd38c6a16585954f2 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Fri, 4 Sep 2020 10:40:24 -0500 Subject: [PATCH 06/19] Update compare-list.graphqls --- .../coverage/catalog/compare-list.graphqls | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index 37371d4ca..816e1cbb6 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -14,30 +14,35 @@ type ComparableAttribute { } type CompareList { - list_id: ID! @doc(description: "Compare list id") + uid: ID! @doc(description: "Compare list id") items: [ComparableItem] @doc(description: "Comparable products") attributes: [ComparableAttribute] @doc(description: "Comparable attributes, provides codes and titles for the attributes") } type Customer { - compareList(id: ID): [CompareList] @doc(description: "Active customers compare list") #id is optional. Introduces the possibility of more than 1 compare list. + compareList(uid: ID): [CompareList] @doc(description: "Active customers compare list") #id is optional. Introduces the possibility of more than 1 compare list. } type Query { - compareList(id: ID!): [CompareList] @doc(description: "Compare list") + compareList(uid: ID!): CompareList @doc(description: "Compare list") } type Mutation { - createCompareList(items: [ID!]): CompareList @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") + createCompareList(input: CreateCompareListInput): CompareList @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") addItemsToCompareList( - id: ID! + uid: ID!, items: [ID!] ): CompareList removeItemsFromCompareList( - id: ID! + uid: ID!, items: [ID!] ): CompareList - assignCompareListToCustomer(customerId: ID!, listId: ID!): Boolean + assignCompareListToCustomer(customerId: ID!, uid: ID!): Boolean! + deleteCompareList(uid: ID!): Boolean! +} + +input CreateCompareListInput { + items: [ID!] } schema { From 52e8c18419a1577bc47a2a383a9bc2a9bf575708 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Tue, 15 Sep 2020 16:00:50 -0500 Subject: [PATCH 07/19] Update compare-list.graphqls --- .../graph-ql/coverage/catalog/compare-list.graphqls | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index 816e1cbb6..0703889b5 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -20,7 +20,7 @@ type CompareList { } type Customer { - compareList(uid: ID): [CompareList] @doc(description: "Active customers compare list") #id is optional. Introduces the possibility of more than 1 compare list. + compare_list: CompareList @doc(description: "Active customers compare list") } type Query { @@ -37,12 +37,12 @@ type Mutation { uid: ID!, items: [ID!] ): CompareList - assignCompareListToCustomer(customerId: ID!, uid: ID!): Boolean! + assignCompareListToCustomer(uid: ID!): CompareList deleteCompareList(uid: ID!): Boolean! } input CreateCompareListInput { - items: [ID!] + products: [ID!] } schema { From 5ca38b94e8851ae2829c81861897ab17cdb739db Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Tue, 15 Sep 2020 17:51:10 -0500 Subject: [PATCH 08/19] Update compare-list.md --- .../graph-ql/coverage/catalog/compare-list.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index b59a92162..7fbb657fb 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -18,7 +18,7 @@ Use createCompareList mutation to create a new compare list. The server should c } ``` * For a guest user, new list will be created -* For a logged in user, exisiting list_id will be returned (Can be extended in future ee - to support multiple compare list per customer) +* For a logged in user, exisiting list_id will be returned ```graphql @@ -33,7 +33,7 @@ Use createCompareList mutation to create a new compare list. The server should c { query { customer { - compare_list(id) { # id filter is optional. Will return an array of compare lists (Future extensibility) + compare_list { list_id items { sku @@ -46,7 +46,7 @@ Use createCompareList mutation to create a new compare list. The server should c * If the registered customer does not have an active list then null will be returned. ``` -assignCompareListToCustomer(customerId: ID!, listId: ID!): CompareList +assignCompareListToCustomer(uid: ID!): CompareList ``` mutation can be used to assign a guest compare list to a registered customer. @@ -112,16 +112,15 @@ catalog_compare_item | catalog_compare_item_id | visitor_id | customer_id | product_id | store_id | ============================================================================== ``` -The visitor_id (non nullable) is tied to session \Magento\Customer\Model\Visitor in Luma. GraphQl layer should not be tied to Luma's session. So Compare-lists via GraphQl will have to differ/deviate from Luma. This dependency can be solved by managing the compare list state in a new table ``` catalog_compare_list ------------------------------------------------------------------------------ -| entity_id (int) (primary)| customer_id (int) (nullable)(indexed)| product_ids (json) (non nullable)| store_id (int) (non nullable)| last_modfied (date) | additional_data (json) (nullable) +| list_id (varchar) (primary)| additional_data (json) (nullable) ============================================================================== ``` -* On first client request, a row will be populated with an entity_id, server generated masked_id, customer_id (? if logged in), product_id and store_id. -* encoded entity_id will be used for client communications -* product_ids is a json field for reducing storage complexity. -* introducing entity_id for the list will enable customers to have more than one compare list (future extensibility) + +and adding list_id field to catalog_compare_item table. + +* encoded list_id will be used for client communications From 8cf881a254ee648470819428c71fafa1dd27c7bf Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 16 Sep 2020 13:47:24 -0500 Subject: [PATCH 09/19] Update compare-list.md --- design-documents/graph-ql/coverage/catalog/compare-list.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index 7fbb657fb..6e70dcd1b 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -103,13 +103,13 @@ preconfigured at the backoffice. Guest compare list business logic not implemented yet. Additional development required. -## Current limitations +## DB changes -Existing table structure for compare list +To the existing table structure for compare list, list_id will be added ``` catalog_compare_item ------------------------------------------------------------------------------ -| catalog_compare_item_id | visitor_id | customer_id | product_id | store_id | +| catalog_compare_item_id | visitor_id | customer_id | product_id | store_id | list_id ============================================================================== ``` @@ -124,3 +124,4 @@ catalog_compare_list and adding list_id field to catalog_compare_item table. * encoded list_id will be used for client communications +* For the visitor ids created via GrahQl session will be null. From b6e841a25d83d5681279d0e2440d47c0e6f43e55 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 16 Sep 2020 15:19:29 -0500 Subject: [PATCH 10/19] Update compare-list.graphqls --- .../coverage/catalog/compare-list.graphqls | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index 0703889b5..1648afb52 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -29,23 +29,30 @@ type Query { type Mutation { createCompareList(input: CreateCompareListInput): CompareList @doc(description: "Creates a new compare list. For a logged in user, the created list is assigned to the user") - addItemsToCompareList( - uid: ID!, - items: [ID!] + addProductsToCompareList( + input: AddProductsToCompareListInput ): CompareList - removeItemsFromCompareList( - uid: ID!, - items: [ID!] + removeProductsFromCompareList( + input: RemoveProductsFromCompareListInput ): CompareList - assignCompareListToCustomer(uid: ID!): CompareList - deleteCompareList(uid: ID!): Boolean! + assignCompareListToCustomer(uid: ID!): CompareList # Customer token needs to be passed + deleteCompareList(uid: ID!): DeleteCompareListOutput } input CreateCompareListInput { - products: [ID!] + products: [ID!]! } -schema { - query: Query, - mutation: Mutation +input AddProductsToCompareListInput { + uid: ID!, + products: [ID!]! +} + +input RemoveProductsFromCompareListInput { + uid: ID!, + products: [ID!]! +} + +type DeleteCompareListOutput { + result: Boolean! } From 28fd8920cf018fe7da18894b2b804159c4c16c9c Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 16 Sep 2020 15:23:41 -0500 Subject: [PATCH 11/19] Update compare-list.graphqls --- .../graph-ql/coverage/catalog/compare-list.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index 1648afb52..a35858b57 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -40,7 +40,7 @@ type Mutation { } input CreateCompareListInput { - products: [ID!]! + products: [ID!] } input AddProductsToCompareListInput { From b5ac23de2bc5dc2d738538a0f4939189bfd4669f Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 16 Sep 2020 15:24:00 -0500 Subject: [PATCH 12/19] Update compare-list.md --- .../graph-ql/coverage/catalog/compare-list.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index 6e70dcd1b..d5f4fecfb 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -8,7 +8,9 @@ Use createCompareList mutation to create a new compare list. The server should c ```graphql { mutation { - createCompareList(items: ["100123", "234567", "874321"]) #items optional + createCompareList(input: { + products: ["123", "456"] + }) #products optional } { list_id items { @@ -117,11 +119,11 @@ This dependency can be solved by managing the compare list state in a new table ``` catalog_compare_list ------------------------------------------------------------------------------ -| list_id (varchar) (primary)| additional_data (json) (nullable) +| list_id (varchar) (primary)| visitor_id | customer_id ============================================================================== ``` and adding list_id field to catalog_compare_item table. -* encoded list_id will be used for client communications -* For the visitor ids created via GrahQl session will be null. +* encoded list_id will be used for client communications # \Magento\Framework\Math\Random::getUniqueHash can be used for hashes +* For visitorsa created via GraphQl, session will be null. From 036a5f2e5e67f081a4f601ba83eedb89b3f18092 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Wed, 16 Sep 2020 15:24:19 -0500 Subject: [PATCH 13/19] Update compare-list.md --- design-documents/graph-ql/coverage/catalog/compare-list.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.md b/design-documents/graph-ql/coverage/catalog/compare-list.md index d5f4fecfb..678f478bc 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.md +++ b/design-documents/graph-ql/coverage/catalog/compare-list.md @@ -126,4 +126,4 @@ catalog_compare_list and adding list_id field to catalog_compare_item table. * encoded list_id will be used for client communications # \Magento\Framework\Math\Random::getUniqueHash can be used for hashes -* For visitorsa created via GraphQl, session will be null. +* For visitors created via GraphQl, session will be null. From 4c7db6c643d6ab44bd0092e6d6482eb7b76192af Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 15 Oct 2020 15:29:22 -0500 Subject: [PATCH 14/19] Update design-documents/graph-ql/coverage/catalog/compare-list.graphqls Co-authored-by: Igor Melnikov --- .../graph-ql/coverage/catalog/compare-list.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index a35858b57..d2cfc840b 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -10,7 +10,7 @@ type ComparableItem { type ComparableAttribute { code: String! @doc(description: "Attribute code ") - title: String! @doc(description: "Attribute display title") + label: String! @doc(description: "Attribute label") } type CompareList { From b9679f5e99f57ec55f5d47be54cb74187ea59795 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 15 Oct 2020 15:57:40 -0500 Subject: [PATCH 15/19] Update compare-list.graphqls --- .../graph-ql/coverage/catalog/compare-list.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index d2cfc840b..a12e4683e 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -2,7 +2,7 @@ type ComparableItem { productId: ID! @doc(description: "Product Id") name: String! @doc(description: "Product name") sku: String! @doc(description: "Product SKU") - priceRange: ProductPriceRange! @doc(description: "Product prices") + price_range: ProductPriceRange! @doc(description: "Product prices") canonical_url: String @doc(description: "Product URL") images: [ProductImage]! @doc(description: "Product Images") values: [ProductAttribute]! @doc(description: "Product comparable attributes") From bd8e5b6df1e885bdb6e81019c83b6f644d8b662f Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Fri, 16 Oct 2020 09:12:55 -0500 Subject: [PATCH 16/19] Removing product_id for now, since its not in scope. Will have to decide between product_id and exposing product interface --- design-documents/graph-ql/coverage/catalog/compare-list.graphqls | 1 - 1 file changed, 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index a12e4683e..c1eca23c1 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -1,5 +1,4 @@ type ComparableItem { - productId: ID! @doc(description: "Product Id") name: String! @doc(description: "Product name") sku: String! @doc(description: "Product SKU") price_range: ProductPriceRange! @doc(description: "Product prices") From 2f7025544acaec122b60580f34b59dfc8e4f93bc Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 22 Oct 2020 12:45:40 -0500 Subject: [PATCH 17/19] After internal discussion, decided its better to return ProductInterface at the ComparableItem Simplifies implementation and usage. --- .../graph-ql/coverage/catalog/compare-list.graphqls | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index c1eca23c1..ea5a4e1be 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -1,13 +1,10 @@ type ComparableItem { - name: String! @doc(description: "Product name") - sku: String! @doc(description: "Product SKU") - price_range: ProductPriceRange! @doc(description: "Product prices") - canonical_url: String @doc(description: "Product URL") - images: [ProductImage]! @doc(description: "Product Images") - values: [ProductAttribute]! @doc(description: "Product comparable attributes") + uid: ID! + product: ProductInterface! } type ComparableAttribute { + uid: ID! code: String! @doc(description: "Attribute code ") label: String! @doc(description: "Attribute label") } From faadf5030f18c172def742e593f3228e6d7c6096 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 22 Oct 2020 13:07:00 -0500 Subject: [PATCH 18/19] Update compare-list.graphqls --- design-documents/graph-ql/coverage/catalog/compare-list.graphqls | 1 + 1 file changed, 1 insertion(+) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index ea5a4e1be..430649ec1 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -1,6 +1,7 @@ type ComparableItem { uid: ID! product: ProductInterface! + attributes: [Attribute]! @doc(description: "Product comparable attributes") } type ComparableAttribute { From a67bd69836675782dc34a6c1ff986fed7328eda3 Mon Sep 17 00:00:00 2001 From: Prabhu Ram Date: Thu, 22 Oct 2020 13:15:31 -0500 Subject: [PATCH 19/19] Update compare-list.graphqls --- .../graph-ql/coverage/catalog/compare-list.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls index 430649ec1..1f6d7c667 100644 --- a/design-documents/graph-ql/coverage/catalog/compare-list.graphqls +++ b/design-documents/graph-ql/coverage/catalog/compare-list.graphqls @@ -1,7 +1,7 @@ type ComparableItem { uid: ID! product: ProductInterface! - attributes: [Attribute]! @doc(description: "Product comparable attributes") + attributes: [ProductAttribute]! @doc(description: "Product comparable attributes") } type ComparableAttribute {