From ee5a8844c45031c762021f5204ae48bf660d1770 Mon Sep 17 00:00:00 2001 From: RakeshJesadiya Date: Tue, 8 Dec 2020 11:52:01 +0530 Subject: [PATCH] customer query improvements --- .../graphql/customer-orders-output.md | 44 +++++++++---------- src/_includes/graphql/customer-output-24.md | 12 +++-- src/_includes/graphql/product-review.md | 4 +- src/guides/v2.3/graphql/queries/customer.md | 2 +- .../graphql/interfaces/product-interface.md | 2 +- src/guides/v2.4/graphql/queries/customer.md | 4 +- 6 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/_includes/graphql/customer-orders-output.md b/src/_includes/graphql/customer-orders-output.md index 5d84468f304..c3a932eaa4f 100644 --- a/src/_includes/graphql/customer-orders-output.md +++ b/src/_includes/graphql/customer-orders-output.md @@ -43,23 +43,23 @@ Attribute | Data type | Description --- | --- | --- `billing_address` | [OrderAddress](#OrderAddress) | The billing address for the order `carrier` | String | The shipping carrier for the order delivery -`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the order +`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments on the order `created_at` | String | Deprecated. Use the `order_date` attribute instead -`credit_memos` | [[CreditMemo](#CreditMemo)] | Contains a list of credit memos for the order +`credit_memos` | [[CreditMemo]](#CreditMemo) | Contains a list of credit memos for the order `grand_total` | Float | Deprecated. Use the `totals.grand_total` attribute instead `gift_message` | [GiftMessage](#GiftMessage) | The entered gift message for the order `gift_receipt_included` | Boolean! | Indicates if the customer requested a gift receipt for the order `gift_wrapping` | [GiftWrapping](#GiftWrapping) | The selected gift wrapping for the order `id` | ID! | Unique identifier for the order `increment_id` | String | Deprecated. Use the `id` attribute instead -`invoices` | [[Invoice](#Invoice)]! | Contains a list of invoices for the order -`items` | [[OrderItemInterface](#OrderItemInterface)] | An array containing the items purchased in this order +`invoices` | [[Invoice]](#Invoice)! | Contains a list of invoices for the order +`items` | [[OrderItemInterface]](#OrderItemInterface) | An array containing the items purchased in this order `number` | String! | The order number `order_date` | String! | The date the order was placed `order_number` | String! | Deprecated. Use the `number` attribute instead -`payment_methods` | [[PaymentMethod](#PaymentMethod)] | Payment details for the order +`payment_methods` | [[PaymentMethod]](#PaymentMethod) | Payment details for the order `printed_card_included` | Boolean! | Indicates if the customer requested a printed card for the order -`shipments` | [[OrderShipment](#OrderShipment)] | Shipment list for the order +`shipments` | [[OrderShipment]](#OrderShipment) | Shipment list for the order `shipping_address` | [OrderAddress](#OrderAddress) | Shipping address for the order `shipping_method` | String | Shipping method for the order `status` | String! | The current status of the order @@ -73,9 +73,9 @@ The `CreditMemo` object contains details about credit memos applied to an order. Attribute | Data type | Description --- | --- | --- -`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the credit memo +`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments on the credit memo `id` | ID! | The unique ID of the credit memo -`items` | [[CreditMemoItemInterface](#CreditMemoItemInterface)] | An array containing details about refunded items +`items` | [[CreditMemoItemInterface]](#CreditMemoItemInterface) | An array containing details about refunded items `number` | String! | The sequential credit memo number `total` | [CreditMemoTotal](#CreditMemoTotal) | Contains details about the total refunded amount @@ -95,11 +95,11 @@ Attribute | Data type | Description --- | --- | --- `adjustment` | Money! | An adjustment manually applied to the order `base_grand_total` | Money! | The final base grand total amount in the base currency -`discounts` | [Discount] | The applied discounts to the order +`discounts` | [[Discount]](#Discount) | The applied discounts to the order `grand_total` | Money! | The final total amount, including shipping, discounts, and taxes `shipping_handling` | [ShippingHandling](#ShippingHandling) | Contains details about the shipping and handling costs for the credit memo `subtotal` | Money! | The subtotal of the order, excluding shipping, discounts, and taxes -`taxes` | [[TaxItem](#TaxItem)]! | An array containing information about taxes on individual orders +`taxes` | [[TaxItem]](#TaxItem)! | An array containing information about taxes on individual orders `total_shipping` | Money! | The shipping amount for the credit memo `total_tax` | Money! | The amount of tax applied to all orders @@ -126,9 +126,9 @@ The `Invoice` object provides details about a customer invoice. Attribute | Data type | Description --- | --- | --- -`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the invoice +`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments on the invoice `id` | ID! | The internal ID of the invoice -`items` | [[InvoiceItemInterface](#InvoiceItemInterface)]! | Contains details about invoiced products +`items` | [[InvoiceItemInterface]](#InvoiceItemInterface)! | Contains details about invoiced products `number` | String! | The sequential number of the invoice `total` | [InvoiceTotal](#InvoiceTotal)! | Invoice total amount details @@ -149,11 +149,11 @@ The InvoiceTotal object contains details about the totals of an invoice. Attribute | Data type | Description --- | --- | --- `base_grand_total` | Money! | The final base grand total amount in the base currency -`discounts` | [Discount] | The applied discounts to the invoice +`discounts` | [[Discount]](#Discount) | The applied discounts to the invoice `grand_total` | Money! | The final total amount, including shipping, discounts, and taxes `shipping_handling` | [ShippingHandling](#ShippingHandling) | Contains details about the shipping and handling costs for the invoice `subtotal` | Money! | The subtotal of the invoice, excluding shipping, discounts, and taxes -`taxes` | [[TaxItem](#TaxItem)] | An array containing information about taxes on individual invoices +`taxes` | [[TaxItem]](#TaxItem) | An array containing information about taxes on individual invoices `total_shipping` | Money! | The shipping amount for the invoice `total_tax` | Money! | The amount of tax applied to all invoices @@ -227,11 +227,11 @@ Attribute | Data type | Description Attribute | Data type | Description --- | --- | --- -`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments added to the shipment +`comments` | [[SalesCommentItem]](#SalesCommentItem) | Comments added to the shipment `id` | ID! | The unique ID of the shipment -`items` | [[ShipmentItemInterface](#ShipmentItemInterface)] | Contains items included in the shipment +`items` | [[ShipmentItemInterface]](#ShipmentItemInterface) | Contains items included in the shipment `number` | String! | The sequential credit shipment number -`tracking` | [[ShipmentTracking](#ShipmentTracking)] | Contains shipment tracking detail +`tracking` | [[ShipmentTracking]](#ShipmentTracking) | Contains shipment tracking detail #### OrderTotal attributes {#OrderTotal} @@ -240,11 +240,11 @@ The `OrderTotal` object contains details about the sales total amounts used to c Attribute | Data type | Description --- | --- | --- `base_grand_total` | Money! | The final base grand total amount in the base currency -`discounts` | [Discount] | The applied discounts to the order +`discounts` | [[Discount]](#Discount) | The applied discounts to the order `grand_total` | Money! | The final total amount, including shipping, discounts, and taxes `shipping_handling` | [ShippingHandling](#ShippingHandling) | The shipping and handling costs for the order `subtotal` | Money! | The subtotal of the order, excluding shipping, discounts, and taxes -`taxes` | [[TaxItem](#TaxItem)]! | An array containing information about taxes on individual orders +`taxes` | [[TaxItem]](#TaxItem)! | An array containing information about taxes on individual orders `total_shipping` | Money! | The shipping costs for the order `total_tax` | Money! | The amount of tax applied to the order @@ -254,7 +254,7 @@ The PaymentMethod data type contains details about the payment method used to pa Attribute | Data type | Description --- | --- | --- -`additional_data` | [[KeyValue](#KeyValue)] | Additional data per payment method type +`additional_data` | [[KeyValue]](#KeyValue) | Additional data per payment method type `name` | String! | The label that describes the payment method `type` | String! | The payment method code that indicates how the order was paid for @@ -378,8 +378,8 @@ Attribute | Data type | Description --- | --- | --- `amount_excluding_tax` | Money | The shipping amount, excluding tax `amount_including_tax` | Money | The shipping amount, including tax -`discounts` | [ShippingDiscount] | The applied discounts to the shipping -`taxes` | [[TaxItem](#TaxItem)] | Contains details about taxes applied for shipping +`discounts` | [[ShippingDiscount]](#ShippingDiscount) | The applied discounts to the shipping +`taxes` | [[TaxItem]](#TaxItem) | Contains details about taxes applied for shipping `total_amount`| Money! | The total amount for shipping #### TaxItem attributes {#TaxItem} diff --git a/src/_includes/graphql/customer-output-24.md b/src/_includes/graphql/customer-output-24.md index 65377603b01..3bc6a3901a8 100644 --- a/src/_includes/graphql/customer-output-24.md +++ b/src/_includes/graphql/customer-output-24.md @@ -2,10 +2,16 @@ {% assign customeraddress_text = '[CustomerAddress](#customerAddressOutput)' %} {% assign customeroutput_text = '[CustomerOrders](#customerOrders)' %} {% assign crossref_text = '. See [`orders` input attributes](#orders) for details' %} +{% assign productreview_text = '[ProductReviews](#ProductReviews)!' %} +{% assign rewardpoints_text = '[RewardPoints](#RewardPoints)' %} +{% assign wishlist_text = '[Wishlist](#Wishlist)!' %} {% else %} {% assign customeraddress_text = 'CustomerAddress' %} {% assign customeroutput_text = '[CustomerOrders]' %} {% assign crossref_text = '' %} +{% assign productreview_text = '[ProductReviews]!' %} +{% assign rewardpoints_text = '[RewardPoints]' %} +{% assign wishlist_text = '[Wishlist]!' %} {% endif %} Attribute | Data Type | Description @@ -26,8 +32,8 @@ Attribute | Data Type | Description `middlename` |String | The customer's middle name `orders()` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }} `prefix` | String | An honorific, such as Dr., Mr., or Mrs. -`reviews(pageSize: Int = 20 currentPage: Int = 1)` | ProductReviews! | The list of reviews of the product -`reward_points` | RewardPoints | Details about the customer's reward points +`reviews(pageSize: Int = 20 currentPage: Int = 1)` | {{ productreview_text }} | The list of reviews of the product +`reward_points` | {{ rewardpoints_text }} | Details about the customer's reward points `suffix` | String | A value such as Sr., Jr., or III `taxvat` | String | The customer's Tax/VAT number (for corporate customers) -`wishlist` | Wishlist! | Contains the contents of the customer's wish lists +`wishlist` | {{ wishlist_text }} | Contains the contents of the customer's wish lists diff --git a/src/_includes/graphql/product-review.md b/src/_includes/graphql/product-review.md index 5123474cd05..b4c28c30587 100644 --- a/src/_includes/graphql/product-review.md +++ b/src/_includes/graphql/product-review.md @@ -5,8 +5,8 @@ Attribute | Data Type | Description `average_rating` | Float! | The average rating for product review `created_at` | String! | Date indicating when the review was created `nickname` | String! | The customer's nickname. Defaults to the customer name, if logged in -`product` | ProductInterface! | Contains details about the reviewed product -`ratings_breakdown` | [ProductReviewRating!]! | An array of ratings by rating category, such as quality, price, and value +`product` | [ProductInterface!]({{ page.baseurl }}/graphql/interfaces/product-interface.html)| Contains details about the reviewed product +`ratings_breakdown` | [[ProductReviewRating!]](#ProductReviewRating)! | An array of ratings by rating category, such as quality, price, and value `summary` | String! | The summary (title) of the review `text` | String! | The review text diff --git a/src/guides/v2.3/graphql/queries/customer.md b/src/guides/v2.3/graphql/queries/customer.md index a2cb63d8caf..113d693b498 100644 --- a/src/guides/v2.3/graphql/queries/customer.md +++ b/src/guides/v2.3/graphql/queries/customer.md @@ -273,7 +273,7 @@ The `customer` object can contain the following attributes: Attribute | Data type | Description --- | --- | --- -`items` | [[WishlistItem](#wishlistitem)] | An array of items in the customer's wish list +`items` | [[WishlistItem]](#wishlistitem) | An array of items in the customer's wish list `items_count` | Int | The number of items in the wish list `id` | ID | The unique identifier of the wish list `sharing_code` | String | An encrypted code that Magento uses to link to the wish list diff --git a/src/guides/v2.4/graphql/interfaces/product-interface.md b/src/guides/v2.4/graphql/interfaces/product-interface.md index dd885643331..e5595e03647 100644 --- a/src/guides/v2.4/graphql/interfaces/product-interface.md +++ b/src/guides/v2.4/graphql/interfaces/product-interface.md @@ -166,7 +166,7 @@ Attribute | Data Type | Description Attribute | Data Type | Description --- | --- | --- -`items` | [ProductReview]! | An array of product reviews +`items` | [[ProductReview]](#ProductReview)! | An array of product reviews `page_info` | [SearchResultPageInfo!]({{page.baseurl}}/graphql/queries/products.html#SearchResultPageInfo) | Metadata for pagination rendering #### ProductReview object {#ProductReview} diff --git a/src/guides/v2.4/graphql/queries/customer.md b/src/guides/v2.4/graphql/queries/customer.md index 78807350083..cf05a81a578 100644 --- a/src/guides/v2.4/graphql/queries/customer.md +++ b/src/guides/v2.4/graphql/queries/customer.md @@ -622,7 +622,7 @@ Attribute | Data Type | Description Attribute | Data Type | Description --- | --- | --- -`items` | [ProductReview]! | An array of product reviews +`items` | [[ProductReview]](#ProductReview)! | An array of product reviews `page_info` | [SearchResultPageInfo!]({{page.baseurl}}/graphql/queries/products.html#SearchResultPageInfo) | Metadata for pagination rendering #### ProductReview object {#ProductReview} @@ -633,7 +633,7 @@ Attribute | Data Type | Description Attribute | Data type | Description --- | --- | --- -`items` | [[WishlistItem](#wishlistitem)] | An array of items in the customer's wish list +`items` | [[WishlistItem]](#wishlistitem) | An array of items in the customer's wish list `items_count` | Int | The number of items in the wish list `id` | ID | The unique identifier of the wish list `sharing_code` | String | An encrypted code that Magento uses to link to the wish list