diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 8c8149133b98b..9f447d7fc7118 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -2,67 +2,67 @@ # See COPYING.txt for license details. type Mutation { - addBundleProductsToCart(input: AddBundleProductsToCartInput): AddBundleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") + addBundleProductsToCart(input: AddBundleProductsToCartInput @doc(description: "An input object that defines which bundle products to add to the cart.")): AddBundleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description: "Add one or more bundle products to the specified cart. We recommend using `addProductsToCart` instead.") } -input AddBundleProductsToCartInput { - cart_id: String! - cart_items: [BundleProductCartItemInput!]! +input AddBundleProductsToCartInput @doc(description: "Defines the bundle products to add to the cart.") { + cart_id: String! @doc(description: "The ID of the cart.") + cart_items: [BundleProductCartItemInput!]! @doc(description: "An array of bundle products to add.") } -input BundleProductCartItemInput { - data: CartItemInput! - bundle_options:[BundleOptionInput!]! - customizable_options:[CustomizableOptionInput!] +input BundleProductCartItemInput @doc(description: "Defines a single bundle product.") { + data: CartItemInput! @doc(description: "The quantity and SKU of the bundle product.") + bundle_options:[BundleOptionInput!]! @doc(description: "A mandatory array of options for the bundle product, including each chosen option and specified quantity.") + customizable_options:[CustomizableOptionInput!] @doc(description: "The ID and value of the option.") } -input BundleOptionInput { - id: Int! - quantity: Float! - value: [String!]! +input BundleOptionInput @doc(description: "Defines the input for a bundle option.") { + id: Int! @doc(description: "The ID of the option.") + quantity: Float! @doc(description: "The number of the selected item to add to the cart.") + value: [String!]! @doc(description: "An array with the chosen value of the option.") } -type AddBundleProductsToCartOutput { - cart: Cart! +type AddBundleProductsToCartOutput @doc(description: "Contains details about the cart after adding bundle products.") { + cart: Cart! @doc(description: "The cart after adding products.") } -type BundleCartItem implements CartItemInterface { - customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") - bundle_options: [SelectedBundleOption!]! @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleOption") +type BundleCartItem implements CartItemInterface @doc(description: "An implementation for bundle product cart items.") { + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing the customizable options the shopper selected.") + bundle_options: [SelectedBundleOption!]! @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleOption") @doc(description: "An array containing the bundle options the shopper selected.") } -type SelectedBundleOption { +type SelectedBundleOption @doc(description: "Contains details about a selected bundle option.") { id: Int! @deprecated(reason: "Use `uid` instead") uid: ID! @doc(description: "The unique ID for a `SelectedBundleOption` object") - label: String! - type: String! - values: [SelectedBundleOptionValue!]! + label: String! @doc(description: "The display name of the selected bundle product option.") + type: String! @doc(description: "The type of selected bundle product option.") + values: [SelectedBundleOptionValue!]! @doc(description: "An array of selected bundle option values.") } -type SelectedBundleOptionValue { +type SelectedBundleOptionValue @doc(description: "Contains details about a value for a selected bundle option.") { id: Int! @doc(description: "Use `uid` instead") uid: ID! @doc(description: "The unique ID for a `SelectedBundleOptionValue` object") - label: String! - quantity: Float! - price: Float! + label: String! @doc(description: "The display name of the value for the selected bundle product option.") + quantity: Float! @doc(description: "The quantity of the value for the selected bundle product option.") + price: Float! @doc(description: "The price of the value for the selected bundle product option.") } -type BundleItem @doc(description: "BundleItem defines an individual item in a bundle product.") { +type BundleItem @doc(description: "Defines an individual item within a bundle product.") { option_id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "An ID assigned to each type of item in a bundle product.") uid: ID @doc(description: "The unique ID for a `BundleItem` object.") title: String @doc(description: "The display name of the item.") required: Boolean @doc(description: "Indicates whether the item must be included in the bundle.") type: String @doc(description: "The input type that the customer uses to select the item. Examples include radio button and checkbox.") - position: Int @doc(description: "he relative position of this item compared to the other bundle items.") + position: Int @doc(description: "A number indicating the sequence order of this item compared to the other bundle items.") sku: String @doc(description: "The SKU of the bundle product.") options: [BundleItemOption] @doc(description: "An array of additional options for this bundle item.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleItemLinks") } -type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") { +type BundleItemOption @doc(description: "Defines the characteristics that comprise a specific bundle item and its options.") { id: Int @deprecated(reason: "Use `uid` instead") @doc(description: "The ID assigned to the bundled item option.") label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label") - qty: Float @deprecated(reason: "The `qty` is deprecated. Use `quantity` instead.") @doc(description: "Indicates the quantity of this specific bundle item.") - quantity: Float @doc(description: "Indicates the quantity of this specific bundle item.") + qty: Float @deprecated(reason: "Use `quantity` instead.") @doc(description: "Indicates the quantity of this specific bundle item.") + quantity: Float @doc(description: "The quantity of this specific bundle item.") position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options.") is_default: Boolean @doc(description: "Indicates whether this option is the default option.") price: Float @doc(description: "The price of the selected option.") @@ -72,57 +72,57 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic uid: ID! @doc(description: "The unique ID for a `BundleItemOption` object.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") } -type BundleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines basic features of a bundle product and contains multiple BundleItems") { +type BundleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines basic features of a bundle product and contains multiple BundleItems.") { price_view: PriceViewEnum @doc(description: "One of PRICE_RANGE or AS_LOW_AS.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\PriceView") dynamic_price: Boolean @doc(description: "Indicates whether the bundle product has a dynamic price.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicPrice") - dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SK.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku") + dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SKU.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku") ship_bundle_items: ShipBundleItemsEnum @doc(description: "Indicates whether to ship bundle items together or individually.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\ShipBundleItems") dynamic_weight: Boolean @doc(description: "Indicates whether the bundle product has a dynamically calculated weight.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicWeight") items: [BundleItem] @doc(description: "An array containing information about individual bundle items.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\BundleItems") } -enum PriceViewEnum @doc(description: "This enumeration defines whether a bundle product's price is displayed as the lowest possible value or as a range.") { +enum PriceViewEnum @doc(description: "Defines whether a bundle product's price is displayed as the lowest possible value or as a range.") { PRICE_RANGE AS_LOW_AS } -enum ShipBundleItemsEnum @doc(description: "This enumeration defines whether bundle items must be shipped together.") { +enum ShipBundleItemsEnum @doc(description: "Defines whether bundle items must be shipped together.") { TOGETHER SEPARATELY } -type BundleOrderItem implements OrderItemInterface { - bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to the bundle product") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") +type BundleOrderItem implements OrderItemInterface @doc(description: "Defines bundle product options for `OrderItemInterface`.") { + bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to the bundle product.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") } -type BundleInvoiceItem implements InvoiceItemInterface{ - bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to the bundle product") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") +type BundleInvoiceItem implements InvoiceItemInterface @doc(description: "Defines bundle product options for `InvoiceItemInterface`.") { + bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to an invoiced bundle product.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") } -type BundleShipmentItem implements ShipmentItemInterface { - bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to the bundle product") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") +type BundleShipmentItem implements ShipmentItemInterface @doc(description: "Defines bundle product options for `ShipmentItemInterface`.") { + bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to a shipped product.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") } -type BundleCreditMemoItem implements CreditMemoItemInterface { - bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to the bundle product") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") +type BundleCreditMemoItem implements CreditMemoItemInterface @doc(description: "Defines bundle product options for `CreditMemoItemInterface`.") { + bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to a bundle product that is part of a credit memo.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions") } -type ItemSelectedBundleOption @doc(description: "A list of options of the selected bundle product") { - id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique ID for a `ItemSelectedBundleOption` object") - uid: ID! @doc(description: "The unique ID for a `ItemSelectedBundleOption` object") - label: String! @doc(description: "The label of the option") - values: [ItemSelectedBundleOptionValue] @doc(description: "A list of products that represent the values of the parent option") +type ItemSelectedBundleOption @doc(description: "A list of options of the selected bundle product.") { + id: ID! @deprecated(reason: "Use `uid` instead.") @doc(description: "The unique ID for a `ItemSelectedBundleOption` object.") + uid: ID! @doc(description: "The unique ID for a `ItemSelectedBundleOption` object.") + label: String! @doc(description: "The label of the option.") + values: [ItemSelectedBundleOptionValue] @doc(description: "A list of products that represent the values of the parent option.") } -type ItemSelectedBundleOptionValue @doc(description: "A list of values for the selected bundle product") { - id: ID! @deprecated(reason: "Use `uid` instead") @doc(description: "The unique ID for a `ItemSelectedBundleOptionValue` object") - uid: ID! @doc(description: "The unique ID for a `ItemSelectedBundleOptionValue` object") - product_name: String! @doc(description: "The name of the child bundle product") - product_sku: String! @doc(description: "The SKU of the child bundle product") - quantity: Float! @doc(description: "Indicates how many of this bundle product were ordered") - price: Money! @doc(description: "The price of the child bundle product") +type ItemSelectedBundleOptionValue @doc(description: "A list of values for the selected bundle product.") { + id: ID! @deprecated(reason: "Use `uid` instead.") @doc(description: "The unique ID for a `ItemSelectedBundleOptionValue` object.") + uid: ID! @doc(description: "The unique ID for a `ItemSelectedBundleOptionValue` object.") + product_name: String! @doc(description: "The name of the child bundle product.") + product_sku: String! @doc(description: "The SKU of the child bundle product.") + quantity: Float! @doc(description: "The number of this bundle product that were ordered.") + price: Money! @doc(description: "The price of the child bundle product.") } -type BundleWishlistItem implements WishlistItemInterface { - bundle_options: [SelectedBundleOption!] @doc(description: "An array containing information about the selected bundle items") @resolver(class: "\\Magento\\BundleGraphQl\\Model\\Wishlist\\BundleOptions") +type BundleWishlistItem implements WishlistItemInterface @doc(description: "Defines bundle product options for `WishlistItemInterface`.") { + bundle_options: [SelectedBundleOption!] @doc(description: "An array containing information about the selected bundle items.") @resolver(class: "\\Magento\\BundleGraphQl\\Model\\Wishlist\\BundleOptions") } diff --git a/app/code/Magento/CatalogCmsGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogCmsGraphQl/etc/schema.graphqls index 0fc5f69a009a4..6ce8f0e81f317 100644 --- a/app/code/Magento/CatalogCmsGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogCmsGraphQl/etc/schema.graphqls @@ -2,5 +2,5 @@ # See COPYING.txt for license details. interface CategoryInterface { - cms_block: CmsBlock @doc(description: "Category CMS Block.") @resolver(class: "Magento\\CatalogCmsGraphQl\\Model\\Resolver\\Category\\Block") -} \ No newline at end of file + cms_block: CmsBlock @doc(description: "Contains a category CMS block.") @resolver(class: "Magento\\CatalogCmsGraphQl\\Model\\Resolver\\Category\\Block") +} diff --git a/app/code/Magento/CatalogCustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogCustomerGraphQl/etc/schema.graphqls index 17880584bf160..aa0140c678974 100644 --- a/app/code/Magento/CatalogCustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogCustomerGraphQl/etc/schema.graphqls @@ -2,21 +2,21 @@ # See COPYING.txt for license details. interface ProductInterface { - tier_prices: [ProductTierPrices] @deprecated(reason: "Use price_tiers for product tier price information.") @doc(description: "An array of ProductTierPrices objects.") @resolver(class: "Magento\\CatalogCustomerGraphQl\\Model\\Resolver\\TierPrices") - price_tiers: [TierPrice] @doc(description: "An array of TierPrice objects.") @resolver(class: "Magento\\CatalogCustomerGraphQl\\Model\\Resolver\\PriceTiers") + tier_prices: [ProductTierPrices] @deprecated(reason: "Use `price_tiers` for product tier price information.") @doc(description: "An array of ProductTierPrices objects.") @resolver(class: "Magento\\CatalogCustomerGraphQl\\Model\\Resolver\\TierPrices") + price_tiers: [TierPrice] @doc(description: "An array of `TierPrice` objects.") @resolver(class: "Magento\\CatalogCustomerGraphQl\\Model\\Resolver\\PriceTiers") } -type ProductTierPrices @doc(description: "ProductTierPrices is deprecated and has been replaced by TierPrice. The ProductTierPrices object defines a tier price, which is a quantity discount offered to a specific customer group.") { - customer_group_id: String @deprecated(reason: "customer_group_id is not relevant for storefront.") @doc(description: "The ID of the customer group.") - qty: Float @deprecated(reason: "ProductTierPrices is deprecated, use TierPrice.quantity.") @doc(description: "The number of items that must be purchased to qualify for tier pricing.") - value: Float @deprecated(reason: "ProductTierPrices is deprecated. Use TierPrice.final_price") @doc(description: "The price of the fixed price item.") - percentage_value: Float @deprecated(reason: "ProductTierPrices is deprecated. Use TierPrice.discount.") @doc(description: "The percentage discount of the item.") - website_id: Float @deprecated(reason: "website_id is not relevant for storefront.") @doc(description: "The ID assigned to the website.") +type ProductTierPrices @doc(description: "Deprecated. Use `TierPrice` instead. Defines a tier price, which is a quantity discount offered to a specific customer group.") { + customer_group_id: String @deprecated(reason: "Not relevant for the storefront.") @doc(description: "The ID of the customer group.") + qty: Float @deprecated(reason: "Use `TierPrice.quantity` instead.") @doc(description: "The number of items that must be purchased to qualify for tier pricing.") + value: Float @deprecated(reason: "Use `TierPrice.final_price` instead.") @doc(description: "The price of the fixed price item.") + percentage_value: Float @deprecated(reason: "Use `TierPrice.discount` instead.") @doc(description: "The percentage discount of the item.") + website_id: Float @deprecated(reason: "Not relevant for the storefront.") @doc(description: "The ID assigned to the website.") } -type TierPrice @doc(description: "A price based on the quantity purchased.") { - final_price: Money @doc(desription: "The price of the product at this tier.") +type TierPrice @doc(description: "Defines a price based on the quantity purchased.") { + final_price: Money @doc(description: "The price of the product at this tier.") quantity: Float @doc(description: "The minimum number of items that must be purchased to qualify for this price tier.") discount: ProductDiscount @doc(description: "The price discount that this tier represents.") } diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 13121597c7be8..0817987a383da 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -3,84 +3,84 @@ type Query { products ( - search: String @doc(description: "Performs a full-text search using the specified key words."), - filter: ProductAttributeFilterInput @doc(description: "Identifies which product attributes to search for and return."), - pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."), - currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."), + search: String @doc(description: "One or more keywords to use in a full-text search."), + filter: ProductAttributeFilterInput @doc(description: "The product attributes to search for and return."), + pageSize: Int = 20 @doc(description: "The maximum number of results to return at once. The default value is 20."), + currentPage: Int = 1 @doc(description: "The page of results to return. The default value is 1."), sort: ProductAttributeSortInput @doc(description: "Specifies which attributes to sort on, and whether to return the results in ascending or descending order.") ): Products - @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Products") @doc(description: "The products query searches for products that match the criteria specified in the search and filter attributes.") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Identity") + @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Products") @doc(description: "Search for products that match the criteria specified in the `search` and `filter` attributes.") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Identity") category ( - id: Int @doc(description: "Id of the category.") + id: Int @doc(description: "The category ID to use as the root of the search.") ): CategoryTree - @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryTree") @doc(description: "The category query searches for categories that match the criteria specified in the search and filter attributes.") @deprecated(reason: "Use 'categoryList' query instead of 'category' query") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoryTreeIdentity") + @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryTree") @doc(description: "Search for categories that match the criteria specified in the `search` and `filter` attributes.") @deprecated(reason: "Use `categoryList` instead.") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoryTreeIdentity") categoryList( filters: CategoryFilterInput @doc(description: "Identifies which Category filter inputs to search for and return.") - ): [CategoryTree] @doc(description: "Returns an array of categories based on the specified filters.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryList") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity") + ): [CategoryTree] @doc(description: "Return an array of categories based on the specified filters.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryList") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity") categories ( filters: CategoryFilterInput @doc(description: "Identifies which Category filter inputs to search for and return.") - pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional.") + pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. The default value is 20.") currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1.") - ): CategoryResult @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoriesQuery") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity") + ): CategoryResult @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoriesQuery") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity") @doc(description: "Return a list of categories that match the specified filter.") } -type Price @doc(description: "Price is deprecated, replaced by ProductPrice. The Price object defines the price of a product as well as any tax-related adjustments.") { - amount: Money @deprecated(reason: "Price is deprecated, use ProductPrice.") @doc(description: "The price of a product plus a three-letter currency code.") - adjustments: [PriceAdjustment] @deprecated(reason: "Price is deprecated, use ProductPrice.") @doc(description: "An array that provides information about tax, weee, or weee_tax adjustments.") +type Price @doc(description: "Deprecated. Use `ProductPrice` instead. Defines the price of a product as well as any tax-related adjustments.") { + amount: Money @deprecated(reason: "Use `ProductPrice` instead.") @doc(description: "The price of a product plus a three-letter currency code.") + adjustments: [PriceAdjustment] @deprecated(reason: "Use `ProductPrice` instead.") @doc(description: "An array that provides information about tax, weee, or weee_tax adjustments.") } -type PriceAdjustment @doc(description: "PriceAdjustment is deprecated. Taxes will be included or excluded in the price. The PricedAdjustment object defines the amount of money to apply as an adjustment, the type of adjustment to apply, and whether the item is included or excluded from the adjustment.") { +type PriceAdjustment @doc(description: "Deprecated. Taxes will be included or excluded in the price. Defines the amount of money to apply as an adjustment, the type of adjustment to apply, and whether the item is included or excluded from the adjustment.") { amount: Money @doc(description: "The amount of the price adjustment and its currency code.") - code: PriceAdjustmentCodesEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the adjustment involves tax, weee, or weee_tax.") - description: PriceAdjustmentDescriptionEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.") + code: PriceAdjustmentCodesEnum @deprecated(reason: "`PriceAdjustment` is deprecated.") @doc(description: "Indicates whether the adjustment involves tax, weee, or weee_tax.") + description: PriceAdjustmentDescriptionEnum @deprecated(reason: "`PriceAdjustment` is deprecated.") @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.") } -enum PriceAdjustmentCodesEnum @doc(description: "PriceAdjustment.code is deprecated. This enumeration contains values defined in modules other than the Catalog module.") { +enum PriceAdjustmentCodesEnum @doc(description: "`PriceAdjustment.code` is deprecated.") { } -enum PriceAdjustmentDescriptionEnum @doc(description: "PriceAdjustmentDescriptionEnum is deprecated. This enumeration states whether a price adjustment is included or excluded.") { +enum PriceAdjustmentDescriptionEnum @doc(description: "`PriceAdjustmentDescriptionEnum` is deprecated. States whether a price adjustment is included or excluded.") { INCLUDED EXCLUDED } -enum PriceTypeEnum @doc(description: "This enumeration the price type.") { +enum PriceTypeEnum @doc(description: "Defines the price type.") { FIXED PERCENT DYNAMIC } -enum CustomizableDateTypeEnum @doc(description: "This enumeration customizable date type.") { +enum CustomizableDateTypeEnum @doc(description: "Defines the customizable date type.") { DATE DATE_TIME TIME } -type ProductPrices @doc(description: "ProductPrices is deprecated, replaced by PriceRange. The ProductPrices object contains the regular price of an item, as well as its minimum and maximum prices. Only composite products, which include bundle, configurable, and grouped products, can contain a minimum and maximum price.") { - minimalPrice: Price @deprecated(reason: "Use PriceRange.minimum_price.") @doc(description: "The lowest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the from value.") - maximalPrice: Price @deprecated(reason: "Use PriceRange.maximum_price.") @doc(description: "The highest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the to value.") - regularPrice: Price @deprecated(reason: "Use regular_price from PriceRange.minimum_price or PriceRange.maximum_price.") @doc(description: "The base price of a product.") +type ProductPrices @doc(description: "Deprecated. Use `PriceRange` instead. Contains the regular price of an item, as well as its minimum and maximum prices. Only composite products, which include bundle, configurable, and grouped products, can contain a minimum and maximum price.") { + minimalPrice: Price @deprecated(reason: "Use `PriceRange.minimum_price` instead.") @doc(description: "The lowest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the `from` value.") + maximalPrice: Price @deprecated(reason: "Use `PriceRange.maximum_price` instead.") @doc(description: "The highest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the `to` value.") + regularPrice: Price @deprecated(reason: "Use `regular_price` from `PriceRange.minimum_price` or `PriceRange.maximum_price` instead.") @doc(description: "The base price of a product.") } -type PriceRange @doc(description: "Price range for a product. If the product has a single price, the minimum and maximum price will be the same."){ +type PriceRange @doc(description: "Contains the price range for a product. If the product has a single price, the minimum and maximum price will be the same."){ minimum_price: ProductPrice! @doc(description: "The lowest possible price for the product.") maximum_price: ProductPrice @doc(description: "The highest possible price for the product.") } type ProductPrice @doc(description: "Represents a product price.") { regular_price: Money! @doc(description: "The regular price of the product.") - final_price: Money! @doc(description: "The final price of the product after discounts applied.") + final_price: Money! @doc(description: "The final price of the product after applying discounts.") discount: ProductDiscount @doc(description: "The price discount. Represents the difference between the regular and final price.") } -type ProductDiscount @doc(description: "A discount applied to a product price.") { +type ProductDiscount @doc(description: "Contains the discount applied to a product price.") { percent_off: Float @doc(description: "The discount expressed a percentage.") amount_off: Float @doc(description: "The actual value of the discount.") } -type ProductLinks implements ProductLinksInterface @doc(description: "ProductLinks is an implementation of ProductLinksInterface.") { +type ProductLinks implements ProductLinksInterface @doc(description: "An implementation of `ProductLinksInterface`.") { } -interface ProductLinksInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductLinkTypeResolverComposite") @doc(description:"ProductLinks contains information about linked products, including the link type and product type of each item.") { +interface ProductLinksInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductLinkTypeResolverComposite") @doc(description:"Contains information about linked products, including the link type and product type of each item.") { sku: String @doc(description: "The identifier of the linked product.") link_type: String @doc(description: "One of related, associated, upsell, or crosssell.") linked_product_sku: String @doc(description: "The SKU of the linked product.") @@ -88,7 +88,7 @@ interface ProductLinksInterface @typeResolver(class: "Magento\\CatalogGraphQl\\M position: Int @doc(description: "The position within the list of product links.") } -interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes.") { +interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "Contains fields that are common to all types of products.") { id: Int @deprecated(reason: "Use the `uid` field instead.") @doc(description: "The ID number assigned to the product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToId") uid: ID! @doc(description: "The unique ID for a `ProductInterface` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\EntityIdToUid") name: String @doc(description: "The product name. Customers use this name to identify the product.") @@ -97,7 +97,7 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ short_description: ComplexTextValue @doc(description: "A short description of the product. Its use depends on the theme.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductComplexTextAttribute") special_price: Float @doc(description: "The discounted price of the product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\SpecialPrice") special_from_date: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The beginning date that a product has a special price.") - special_to_date: String @doc(description: "The end date that a product has a special price.") + special_to_date: String @doc(description: "The end date for a product with a special price.") attribute_set_id: Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The attribute set assigned to the product.") meta_title: String @doc(description: "A string that is displayed in the title bar and tab of the browser and in search results lists.") meta_keyword: String @doc(description: "A comma-separated list of keywords that are visible only to search engines.") @@ -107,34 +107,34 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ thumbnail: ProductImage @doc(description: "The relative path to the product's thumbnail image.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductImage") new_from_date: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The beginning date for new product listings, and determines if the product is featured as a new product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") new_to_date: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The end date for new product listings.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\NewFromTo") - tier_price: Float @deprecated(reason: "Use price_tiers for product tier price information.") @doc(description: "The price when tier pricing is in effect and the items purchased threshold has been reached.") + tier_price: Float @deprecated(reason: "Use `price_tiers` for product tier price information.") @doc(description: "The price when tier pricing is in effect and the items purchased threshold has been reached.") options_container: String @doc(description: "If the product has multiple options, determines where they appear on the product page.") created_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the product was created.") updated_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the product was updated.") country_of_manufacture: String @doc(description: "The product's country of origin.") - type_id: String @doc(description: "One of simple, virtual, bundle, downloadable, grouped, or configurable.") @deprecated(reason: "Use __typename instead.") + type_id: String @doc(description: "One of simple, virtual, bundle, downloadable, grouped, or configurable.") @deprecated(reason: "Use `__typename` instead.") websites: [Website] @doc(description: "An array of websites in which the product is available.") @deprecated(reason: "The field should not be used on the storefront.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Websites") - product_links: [ProductLinksInterface] @doc(description: "An array of ProductLinks objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\BatchProductLinks") - media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use product's `media_gallery` instead") @doc(description: "An array of MediaGalleryEntry objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGalleryEntries") - price: ProductPrices @deprecated(reason: "Use price_range for product price information.") @doc(description: "A ProductPrices object, indicating the price of an item.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Price") - price_range: PriceRange! @doc(description: "A PriceRange object, indicating the range of prices for the product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\PriceRange") + product_links: [ProductLinksInterface] @doc(description: "An array of `ProductLinks` objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\BatchProductLinks") + media_gallery_entries: [MediaGalleryEntry] @deprecated(reason: "Use `media_gallery` instead.") @doc(description: "An array of MediaGalleryEntry objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGalleryEntries") + price: ProductPrices @deprecated(reason: "Use `price_range` for product price information.") @doc(description: "Indicates the price of an item.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Price") + price_range: PriceRange! @doc(description: "The range of prices for the product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\PriceRange") gift_message_available: String @doc(description: "Indicates whether a gift message is available.") manufacturer: Int @doc(description: "A number representing the product's manufacturer.") categories: [CategoryInterface] @doc(description: "The categories assigned to a product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Categories") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity") - canonical_url: String @doc(description: "Relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Products' is enabled") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CanonicalUrl") - media_gallery: [MediaGalleryInterface] @doc(description: "An array of Media Gallery objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery") + canonical_url: String @doc(description: "The relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Products' is enabled.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CanonicalUrl") + media_gallery: [MediaGalleryInterface] @doc(description: "An array of media gallery objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery") } -interface PhysicalProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "PhysicalProductInterface contains attributes specific to tangible products.") { +interface PhysicalProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "Contains attributes specific to tangible products.") { weight: Float @doc(description: "The weight of the item, in units defined by the store.") } -type CustomizableAreaOption implements CustomizableOptionInterface @doc(description: "CustomizableAreaOption contains information about a text area that is defined as part of a customizable option.") { +type CustomizableAreaOption implements CustomizableOptionInterface @doc(description: "Contains information about a text area that is defined as part of a customizable option.") { value: CustomizableAreaValue @doc(description: "An object that defines a text area.") product_sku: String @doc(description: "The Stock Keeping Unit of the base product.") } -type CustomizableAreaValue @doc(description: "CustomizableAreaValue defines the price and sku of a product whose page contains a customized text area.") { +type CustomizableAreaValue @doc(description: "Defines the price and sku of a product whose page contains a customized text area.") { price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") @@ -142,22 +142,22 @@ type CustomizableAreaValue @doc(description: "CustomizableAreaValue defines the uid: ID! @doc(description: "The unique ID for a `CustomizableAreaValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } -type CategoryTree implements CategoryInterface, RoutableInterface @doc(description: "Category tree implementation") { - children: [CategoryTree] @doc(description: "Child categories tree.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryTree") +type CategoryTree implements CategoryInterface, RoutableInterface @doc(description: "Contains the hierarchy of categories.") { + children: [CategoryTree] @doc(description: "A tree of child categories.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryTree") } -type CategoryResult @doc(description: "A collection of CategoryTree objects and pagination information.") { +type CategoryResult @doc(description: "Contains a collection of `CategoryTree` objects and pagination information.") { items: [CategoryTree] @doc(description: "A list of categories that match the filter criteria.") - page_info: SearchResultPageInfo @doc(description: "An object that includes the page_info and currentPage values specified in the query.") + page_info: SearchResultPageInfo @doc(description: "An object that includes the `page_info` and `currentPage` values specified in the query.") total_count: Int @doc(description: "The total number of categories that match the criteria.") } -type CustomizableDateOption implements CustomizableOptionInterface @doc(description: "CustomizableDateOption contains information about a date picker that is defined as part of a customizable option.") { +type CustomizableDateOption implements CustomizableOptionInterface @doc(description: "Contains information about a date picker that is defined as part of a customizable option.") { value: CustomizableDateValue @doc(description: "An object that defines a date field in a customizable option.") product_sku: String @doc(description: "The Stock Keeping Unit of the base product.") } -type CustomizableDateValue @doc(description: "CustomizableDateValue defines the price and sku of a product whose page contains a customized date picker.") { +type CustomizableDateValue @doc(description: "Defines the price and sku of a product whose page contains a customized date picker.") { price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") type: CustomizableDateTypeEnum @doc(description: "DATE, DATE_TIME or TIME") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableDateTypeOptionValue") @@ -165,11 +165,11 @@ type CustomizableDateValue @doc(description: "CustomizableDateValue defines the uid: ID! @doc(description: "The unique ID for a `CustomizableDateValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } -type CustomizableDropDownOption implements CustomizableOptionInterface @doc(description: "CustomizableDropDownOption contains information about a drop down menu that is defined as part of a customizable option.") { +type CustomizableDropDownOption implements CustomizableOptionInterface @doc(description: "Contains information about a drop down menu that is defined as part of a customizable option.") { value: [CustomizableDropDownValue] @doc(description: "An array that defines the set of options for a drop down menu.") } -type CustomizableDropDownValue @doc(description: "CustomizableDropDownValue defines the price and sku of a product whose page contains a customized drop down menu.") { +type CustomizableDropDownValue @doc(description: "Defines the price and sku of a product whose page contains a customized drop down menu.") { option_type_id: Int @doc(description: "The ID assigned to the value.") price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") @@ -179,11 +179,11 @@ type CustomizableDropDownValue @doc(description: "CustomizableDropDownValue defi uid: ID! @doc(description: "The unique ID for a `CustomizableDropDownValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } -type CustomizableMultipleOption implements CustomizableOptionInterface @doc(description: "CustomizableMultipleOption contains information about a multiselect that is defined as part of a customizable option.") { +type CustomizableMultipleOption implements CustomizableOptionInterface @doc(description: "Contains information about a multiselect that is defined as part of a customizable option.") { value: [CustomizableMultipleValue] @doc(description: "An array that defines the set of options for a multiselect.") } -type CustomizableMultipleValue @doc(description: "CustomizableMultipleValue defines the price and sku of a product whose page contains a customized multiselect.") { +type CustomizableMultipleValue @doc(description: "Defines the price and sku of a product whose page contains a customized multiselect.") { option_type_id: Int @doc(description: "The ID assigned to the value.") price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") @@ -193,12 +193,12 @@ type CustomizableMultipleValue @doc(description: "CustomizableMultipleValue defi uid: ID! @doc(description: "The unique ID for a `CustomizableMultipleValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } -type CustomizableFieldOption implements CustomizableOptionInterface @doc(description: "CustomizableFieldOption contains information about a text field that is defined as part of a customizable option.") { +type CustomizableFieldOption implements CustomizableOptionInterface @doc(description: "Contains information about a text field that is defined as part of a customizable option.") { value: CustomizableFieldValue @doc(description: "An object that defines a text field.") product_sku: String @doc(description: "The Stock Keeping Unit of the base product.") } -type CustomizableFieldValue @doc(description: "CustomizableFieldValue defines the price and sku of a product whose page contains a customized text field.") { +type CustomizableFieldValue @doc(description: "Defines the price and sku of a product whose page contains a customized text field.") { price: Float @doc(description: "The price of the custom value.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") @@ -206,12 +206,12 @@ type CustomizableFieldValue @doc(description: "CustomizableFieldValue defines th uid: ID! @doc(description: "The unique ID for a `CustomizableFieldValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } -type CustomizableFileOption implements CustomizableOptionInterface @doc(description: "CustomizableFileOption contains information about a file picker that is defined as part of a customizable option.") { +type CustomizableFileOption implements CustomizableOptionInterface @doc(description: "Contains information about a file picker that is defined as part of a customizable option.") { value: CustomizableFileValue @doc(description: "An object that defines a file value.") product_sku: String @doc(description: "The Stock Keeping Unit of the base product.") } -type CustomizableFileValue @doc(description: "CustomizableFileValue defines the price and sku of a product whose page contains a customized file picker.") { +type CustomizableFileValue @doc(description: "Defines the price and sku of a product whose page contains a customized file picker.") { price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") sku: String @doc(description: "The Stock Keeping Unit for this option.") @@ -225,17 +225,17 @@ interface MediaGalleryInterface @doc(description: "Contains basic information ab url: String @doc(description: "The URL of the product image or video.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery\\Url") label: String @doc(description: "The label of the product image or video.") position: Int @doc(description: "The media item's position after it has been sorted.") - disabled: Boolean @doc(description: "Whether the image is hidden from view.") + disabled: Boolean @doc(description: "Indicates whether the image is hidden from view.") } -type ProductImage implements MediaGalleryInterface @doc(description: "Product image information. Contains the image URL and label.") { +type ProductImage implements MediaGalleryInterface @doc(description: "Contains product image information, including the image URL and label.") { } type ProductVideo implements MediaGalleryInterface @doc(description: "Contains information about a product video.") { - video_content: ProductMediaGalleryEntriesVideoContent @doc(description: "Contains a ProductMediaGalleryEntriesVideoContent object.") + video_content: ProductMediaGalleryEntriesVideoContent @doc(description: "Contains a `ProductMediaGalleryEntriesVideoContent` object.") } -interface CustomizableOptionInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CustomizableOptionTypeResolver") @doc(description: "The CustomizableOptionInterface contains basic information about a customizable option. It can be implemented by several types of configurable options.") { +interface CustomizableOptionInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CustomizableOptionTypeResolver") @doc(description: "Contains basic information about a customizable option. It can be implemented by several types of configurable options.") { title: String @doc(description: "The display name for this option.") required: Boolean @doc(description: "Indicates whether the option is required.") sort_order: Int @doc(description: "The order in which the option is displayed.") @@ -243,48 +243,48 @@ interface CustomizableOptionInterface @typeResolver(class: "Magento\\CatalogGrap uid: ID! @doc(description: "The unique ID for a `CustomizableOptionInterface` object.") } -interface CustomizableProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "CustomizableProductInterface contains information about customizable product options.") { +interface CustomizableProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "Contains information about customizable product options.") { options: [CustomizableOptionInterface] @doc(description: "An array of options for a customizable product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Options") } -interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CategoryInterfaceTypeResolver") @doc(description: "CategoryInterface contains the full set of attributes that can be returned in a category search.") { - id: Int @deprecated(reason: "Use the `uid` argument instead.") @doc(description: "An ID that uniquely identifies the category.") +interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\CategoryInterfaceTypeResolver") @doc(description: "Contains the full set of attributes that can be returned in a category search.") { + id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "An ID that uniquely identifies the category.") uid: ID! @doc(description: "The unique ID for a `CategoryInterface` object.") description: String @doc(description: "An optional description of the category.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoryHtmlAttribute") name: String @doc(description: "The display name of the category.") - path: String @doc(description: "Category Path.") - path_in_store: String @doc(description: "Category path in store.") - url_key: String @doc(description: "The url key assigned to the category.") - url_path: String @doc(description: "The url path assigned to the category.") - canonical_url: String @doc(description: "Relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Categories' is enabled") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CanonicalUrl") + path: String @doc(description: "The full category path.") + path_in_store: String @doc(description: "The category path within the store.") + url_key: String @doc(description: "The URL key assigned to the category.") + url_path: String @doc(description: "The URL path assigned to the category.") + canonical_url: String @doc(description: "The relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Categories' is enabled.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CanonicalUrl") position: Int @doc(description: "The position of the category relative to other categories at the same level in tree.") - level: Int @doc(description: "Indicates the depth of the category within the tree.") - created_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the category was created.") - updated_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Timestamp indicating when the category was updated.") + level: Int @doc(description: "The depth of the category within the tree.") + created_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The timestamp indicating when the category was created.") + updated_at: String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The timestamp indicating when the category was updated.") product_count: Int @doc(description: "The number of products in the category that are marked as visible. By default, in complex products, parent products are visible, but their child products are not.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\ProductsCount") default_sort_by: String @doc(description: "The attribute to use for sorting.") products( - pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."), - currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."), - sort: ProductAttributeSortInput @doc(description: "Specifies which attributes to sort on, and whether to return the results in ascending or descending order.") + pageSize: Int = 20 @doc(description: "The maximum number of results to return at once. The default value is 20."), + currentPage: Int = 1 @doc(description: "The page of results to return. The default value is 1."), + sort: ProductAttributeSortInput @doc(description: "The attributes to sort on, and whether to return the results in ascending or descending order.") ): CategoryProducts @doc(description: "The list of products assigned to the category.") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Identity") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\Products") - breadcrumbs: [Breadcrumb] @doc(description: "Breadcrumbs, parent categories info.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\Breadcrumbs") + breadcrumbs: [Breadcrumb] @doc(description: "An array of breadcrumb items.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\Breadcrumbs") } -type Breadcrumb @doc(description: "Breadcrumb item.") { - category_id: Int @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Category ID.") +type Breadcrumb @doc(description: "Contains details about an individual category that comprises a breadcrumb.") { + category_id: Int @deprecated(reason: "Use `category_uid` instead.") @doc(description: "The ID of the category.") category_uid: ID! @doc(description: "The unique ID for a `Breadcrumb` object.") - category_name: String @doc(description: "Category name.") - category_level: Int @doc(description: "Category level.") - category_url_key: String @doc(description: "Category URL key.") - category_url_path: String @doc(description: "Category URL path.") + category_name: String @doc(description: "The display name of the category.") + category_level: Int @doc(description: "The category level.") + category_url_key: String @doc(description: "The URL key of the category.") + category_url_path: String @doc(description: "The URL path of the category.") } -type CustomizableRadioOption implements CustomizableOptionInterface @doc(description: "CustomizableRadioOption contains information about a set of radio buttons that are defined as part of a customizable option.") { +type CustomizableRadioOption implements CustomizableOptionInterface @doc(description: "Contains information about a set of radio buttons that are defined as part of a customizable option.") { value: [CustomizableRadioValue] @doc(description: "An array that defines a set of radio buttons.") } -type CustomizableRadioValue @doc(description: "CustomizableRadioValue defines the price and sku of a product whose page contains a customized set of radio buttons.") { +type CustomizableRadioValue @doc(description: "Defines the price and sku of a product whose page contains a customized set of radio buttons.") { option_type_id: Int @doc(description: "The ID assigned to the value.") price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") @@ -294,11 +294,11 @@ type CustomizableRadioValue @doc(description: "CustomizableRadioValue defines th uid: ID! @doc(description: "The unique ID for a `CustomizableRadioValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } -type CustomizableCheckboxOption implements CustomizableOptionInterface @doc(description: "CustomizableCheckbbixOption contains information about a set of checkbox values that are defined as part of a customizable option.") { +type CustomizableCheckboxOption implements CustomizableOptionInterface @doc(description: "Contains information about a set of checkbox values that are defined as part of a customizable option.") { value: [CustomizableCheckboxValue] @doc(description: "An array that defines a set of checkbox values.") } -type CustomizableCheckboxValue @doc(description: "CustomizableCheckboxValue defines the price and sku of a product whose page contains a customized set of checkbox values.") { +type CustomizableCheckboxValue @doc(description: "Defines the price and sku of a product whose page contains a customized set of checkbox values.") { option_type_id: Int @doc(description: "The ID assigned to the value.") price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") @@ -308,19 +308,19 @@ type CustomizableCheckboxValue @doc(description: "CustomizableCheckboxValue defi uid: ID! @doc(description: "The unique ID for a `CustomizableCheckboxValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } -type VirtualProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "A virtual product is a non-tangible product that does not require shipping and is not kept in inventory") { +type VirtualProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "Defines a virtual product, which is a non-tangible product that does not require shipping and is not kept in inventory.") { } -type SimpleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "A simple product is tangible and is usually sold in single units or in fixed quantities") +type SimpleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines a simple product, which is tangible and is usually sold in single units or in fixed quantities.") { } -type Products @doc(description: "The Products object is the top-level object returned in a product search.") { +type Products @doc(description: "Contains the results of a `products` query.") { items: [ProductInterface] @doc(description: "An array of products that match the specified search criteria.") page_info: SearchResultPageInfo @doc(description: "An object that includes the page_info and currentPage values specified in the query.") total_count: Int @doc(description: "The number of products that are marked as visible. By default, in complex products, parent products are visible, but their child products are not.") - filters: [LayerFilter] @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\LayerFilters") @doc(description: "Layered navigation filters array.") @deprecated(reason: "Use aggregations instead") - aggregations (filter: AggregationsFilterInput): [Aggregation] @doc(description: "Layered navigation aggregations with filters.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Aggregations") + filters: [LayerFilter] @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\LayerFilters") @doc(description: "Layered navigation filters array.") @deprecated(reason: "Use `aggregations` instead.") + aggregations (filter: AggregationsFilterInput): [Aggregation] @doc(description: "A bucket that contains the attribute code and label for each filterable option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Aggregations") sort_fields: SortFields @doc(description: "An object that includes the default sort field and all available sort fields.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\SortFields") suggestions: [SearchSuggestion] @doc(description: "An array of search suggestions for case when search query have no results.") } @@ -333,20 +333,20 @@ input AggregationsCategoryFilterInput @doc(description: "Filter category aggrega includeDirectChildrenOnly: Boolean = false @doc(description: "Indicates whether to include only direct subcategories or all children categories at all levels.") } -type CategoryProducts @doc(description: "The category products object returned in the Category query.") { +type CategoryProducts @doc(description: "Contains details about the products assigned to a category.") { items: [ProductInterface] @doc(description: "An array of products that are assigned to the category.") - page_info: SearchResultPageInfo @doc(description: "An object that includes the page_info and currentPage values specified in the query.") + page_info: SearchResultPageInfo @doc(description: "Pagination metadata.") total_count: Int @doc(description: "The number of products in the category that are marked as visible. By default, in complex products, parent products are visible, but their child products are not.") } -input ProductAttributeFilterInput @doc(description: "ProductAttributeFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { - category_id: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use `category_uid` to filter product by category id.") +input ProductAttributeFilterInput @doc(description: "Defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { + category_id: FilterEqualTypeInput @deprecated(reason: "Use `category_uid` instead.") @doc(description: "Deprecated: use `category_uid` to filter product by category ID.") category_uid: FilterEqualTypeInput @doc(description: "Filter product by the unique ID for a `CategoryInterface` object.") } -input CategoryFilterInput @doc(description: "CategoryFilterInput defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") +input CategoryFilterInput @doc(description: "Defines the filters to be used in the search. A filter contains at least one attribute, a comparison operator, and the value that is being searched for.") { - ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use 'category_uid' to filter uniquely identifiers of categories.") + ids: FilterEqualTypeInput @deprecated(reason: "Use `category_uid` instead.") @doc(description: "Deprecated: use 'category_uid' to filter uniquely identifiers of categories.") category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique category ID for a `CategoryInterface` object.") parent_id: FilterEqualTypeInput @deprecated @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") parent_category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") @@ -378,28 +378,28 @@ input ProductFilterInput @doc(description: "ProductFilterInput is deprecated, us custom_layout_update: FilterTypeInput @doc(description: "XML code that is applied as a layout update to the product page.") min_price: FilterTypeInput @doc(description:"The numeric minimal price of the product. Do not include the currency code.") max_price: FilterTypeInput @doc(description:"The numeric maximal price of the product. Do not include the currency code.") - category_id: FilterTypeInput @doc(description: "Category ID the product belongs to.") + category_id: FilterTypeInput @doc(description: "The category ID the product belongs to.") options_container: FilterTypeInput @doc(description: "If the product has multiple options, determines where they appear on the product page.") required_options: FilterTypeInput @doc(description: "Indicates whether the product has required options.") has_options: FilterTypeInput @doc(description: "Indicates whether additional attributes have been created for the product.") image_label: FilterTypeInput @doc(description: "The label assigned to a product image.") small_image_label: FilterTypeInput @doc(description: "The label assigned to a product's small image.") thumbnail_label: FilterTypeInput @doc(description: "The label assigned to a product's thumbnail image.") - created_at: FilterTypeInput @doc(description: "Timestamp indicating when the product was created.") - updated_at: FilterTypeInput @doc(description: "Timestamp indicating when the product was updated.") + created_at: FilterTypeInput @doc(description: "The timestamp indicating when the product was created.") + updated_at: FilterTypeInput @doc(description: "The timestamp indicating when the product was updated.") country_of_manufacture: FilterTypeInput @doc(description: "The product's country of origin.") custom_layout: FilterTypeInput @doc(description: "The name of a custom layout.") gift_message_available: FilterTypeInput @doc(description: "Indicates whether a gift message is available.") or: ProductFilterInput @doc(description: "The keyword required to perform a logical OR comparison.") } -type ProductMediaGalleryEntriesContent @doc(description: "ProductMediaGalleryEntriesContent contains an image in base64 format and basic information about the image.") { +type ProductMediaGalleryEntriesContent @doc(description: "Contains an image in base64 format and basic information about the image.") { base64_encoded_data: String @doc(description: "The image in base64 format.") type: String @doc(description: "The MIME type of the file, such as image/png.") name: String @doc(description: "The file name of the image.") } -type ProductMediaGalleryEntriesVideoContent @doc(description: "ProductMediaGalleryEntriesVideoContent contains a link to a video file and basic information about the video.") { +type ProductMediaGalleryEntriesVideoContent @doc(description: "Contains a link to a video file and basic information about the video.") { media_type: String @doc(description: "Must be external-video.") video_provider: String @doc(description: "Describes the video source.") video_url: String @doc(description: "The URL to the video.") @@ -408,7 +408,7 @@ type ProductMediaGalleryEntriesVideoContent @doc(description: "ProductMediaGalle video_metadata: String @doc(description: "Optional data about the video.") } -input ProductSortInput @doc(description: "ProductSortInput is deprecated, use @ProductAttributeSortInput instead. ProductSortInput specifies the attribute to use for sorting search results and indicates whether the results are sorted in ascending or descending order.") { +input ProductSortInput @doc(description: "Deprecated. Use `ProductAttributeSortInput` instead. Specifies the attribute to use for sorting search results and indicates whether the results are sorted in ascending or descending order.") { name: SortEnum @doc(description: "The product name. Customers use this name to identify the product.") sku: SortEnum @doc(description: "A number or code assigned to a product to identify the product, options, price, and manufacturer.") description: SortEnum @doc(description: "Detailed information about the product. The value can include simple HTML tags.") @@ -435,97 +435,97 @@ input ProductSortInput @doc(description: "ProductSortInput is deprecated, use @P image_label: SortEnum @doc(description: "The label assigned to a product image.") small_image_label: SortEnum @doc(description: "The label assigned to a product's small image.") thumbnail_label: SortEnum @doc(description: "The label assigned to a product's thumbnail image.") - created_at: SortEnum @doc(description: "Timestamp indicating when the product was created.") - updated_at: SortEnum @doc(description: "Timestamp indicating when the product was updated.") + created_at: SortEnum @doc(description: "The timestamp indicating when the product was created.") + updated_at: SortEnum @doc(description: "The timestamp indicating when the product was updated.") country_of_manufacture: SortEnum @doc(description: "The product's country of origin.") custom_layout: SortEnum @doc(description: "The name of a custom layout.") gift_message_available: SortEnum @doc(description: "Indicates whether a gift message is available.") } -input ProductAttributeSortInput @doc(description: "ProductAttributeSortInput specifies the attribute to use for sorting search results and indicates whether the results are sorted in ascending or descending order. It's possible to sort products using searchable attributes with enabled 'Use in Filter Options' option") +input ProductAttributeSortInput @doc(description: "Specifies the attribute to use for sorting search results and indicates whether the results are sorted in ascending or descending order. It's possible to sort products using searchable attributes with enabled 'Use in Filter Options' option") { relevance: SortEnum @doc(description: "Sort by the search relevance score (default).") position: SortEnum @doc(description: "Sort by the position assigned to each product.") } -type MediaGalleryEntry @doc(description: "MediaGalleryEntry defines characteristics about images and videos associated with a specific product.") { +type MediaGalleryEntry @doc(description: "Defines characteristics about images and videos associated with a specific product.") { id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The identifier assigned to the object.") uid: ID! @doc(description: "The unique ID for a `MediaGalleryEntry` object.") - media_type: String @doc(description: "image or video.") - label: String @doc(description: "The alt text displayed on the UI when the user points to the image.") + media_type: String @doc(description: "Either `image` or `video`.") + label: String @doc(description: "The alt text displayed on the storefront when the user points to the image.") position: Int @doc(description: "The media item's position after it has been sorted.") - disabled: Boolean @doc(description: "Whether the image is hidden from view.") + disabled: Boolean @doc(description: "Indicates whether the image is hidden from view.") types: [String] @doc(description: "Array of image types. It can have the following values: image, small_image, thumbnail.") file: String @doc(description: "The path of the image on the server.") - content: ProductMediaGalleryEntriesContent @doc(description: "Contains a ProductMediaGalleryEntriesContent object.") - video_content: ProductMediaGalleryEntriesVideoContent @doc(description: "Contains a ProductMediaGalleryEntriesVideoContent object.") + content: ProductMediaGalleryEntriesContent @doc(description: "Details about the content of the media gallery item.") + video_content: ProductMediaGalleryEntriesVideoContent @doc(description: "Details about the content of a video item.") } -type LayerFilter { - name: String @doc(description: "Layered navigation filter name.") @deprecated(reason: "Use Aggregation.label instead.") - request_var: String @doc(description: "Request variable name for filter query.") @deprecated(reason: "Use Aggregation.attribute_code instead.") - filter_items_count: Int @doc(description: "Count of filter items in filter group.") @deprecated(reason: "Use Aggregation.count instead.") - filter_items: [LayerFilterItemInterface] @doc(description: "Array of filter items.") @deprecated(reason: "Use Aggregation.options instead.") +type LayerFilter @doc(description: "Contains information for rendering layered navigation.") { + name: String @doc(description: "The name of a layered navigation filter.") @deprecated(reason: "Use `Aggregation.label` instead.") + request_var: String @doc(description: "The request variable name for a filter query.") @deprecated(reason: "Use `Aggregation.attribute_code` instead.") + filter_items_count: Int @doc(description: "The count of filter items in filter group.") @deprecated(reason: "Use `Aggregation.count` instead.") + filter_items: [LayerFilterItemInterface] @doc(description: "An array of filter items.") @deprecated(reason: "Use `Aggregation.options` instead.") } interface LayerFilterItemInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\LayerFilterItemTypeResolverComposite") { - label: String @doc(description: "Filter label.") @deprecated(reason: "Use AggregationOption.label instead.") - value_string: String @doc(description: "Value for filter request variable to be used in query.") @deprecated(reason: "Use AggregationOption.value instead.") - items_count: Int @doc(description: "Count of items by filter.") @deprecated(reason: "Use AggregationOption.count instead.") + label: String @doc(description: "The label for a filter.") @deprecated(reason: "Use `AggregationOption.label` instead.") + value_string: String @doc(description: "The value of a filter request variable to be used in query.") @deprecated(reason: "Use `AggregationOption.value` instead.") + items_count: Int @doc(description: "The count of items per filter.") @deprecated(reason: "Use `AggregationOption.count` instead.") } type LayerFilterItem implements LayerFilterItemInterface { } -type Aggregation @doc(description: "A bucket that contains information for each filterable option (such as price, category `UID`, and custom attributes).") { +type Aggregation @doc(description: "Contains information for each filterable option (such as price, category `UID`, and custom attributes).") { count: Int @doc(description: "The number of options in the aggregation group.") label: String @doc(description: "The aggregation display name.") attribute_code: String! @doc(description: "Attribute code of the aggregation group.") options: [AggregationOption] @doc(description: "Array of options for the aggregation.") - position: Int @doc(description: "The relative position of the attribute in a layered navigation block") + position: Int @doc(description: "The relative position of the attribute in a layered navigation block.") } type SearchSuggestion @doc(description: "A string that contains search suggestion") { search: String! @doc(description: "The search suggestion of existing product.") } -interface AggregationOptionInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\AggregationOptionTypeResolverComposite") { +interface AggregationOptionInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\AggregationOptionTypeResolverComposite") @doc(description: "Defines aggregation option fields.") { count: Int @doc(description: "The number of items that match the aggregation option.") - label: String @doc(description: "Aggregation option display label.") + label: String @doc(description: "The display label for an aggregation option.") value: String! @doc(description: "The internal ID that represents the value of the option.") } -type AggregationOption implements AggregationOptionInterface { +type AggregationOption implements AggregationOptionInterface @doc(description: "An implementation of `AggregationOptionInterface`.") { } -type SortField { - value: String @doc(description: "Attribute code of sort field.") - label: String @doc(description: "Label of sort field.") +type SortField @doc(description: "Defines a possible sort field.") { + value: String @doc(description: "The attribute code of the sort field.") + label: String @doc(description: "The label of the sort field.") } -type SortFields @doc(description: "SortFields contains a default value for sort fields and all available sort fields.") { - default: String @doc(description: "Default value of sort fields.") - options: [SortField] @doc(description: "Available sort fields.") +type SortFields @doc(description: "Contains a default value for sort fields and all available sort fields.") { + default: String @doc(description: "The default sort field value.") + options: [SortField] @doc(description: "An array of possible sort fields.") } -type StoreConfig @doc(description: "The type contains information about a store config.") { - product_url_suffix : String @doc(description: "Product URL Suffix.") - category_url_suffix : String @doc(description: "Category URL Suffix.") - title_separator : String @doc(description: "Page Title Separator.") - list_mode : String @doc(description: "List Mode.") - grid_per_page_values : String @doc(description: "Products per Page on Grid Allowed Values.") - list_per_page_values : String @doc(description: "Products per Page on List Allowed Values.") - grid_per_page : Int @doc(description: "Products per Page on Grid Default Value.") - list_per_page : Int @doc(description: "Products per Page on List Default Value.") - catalog_default_sort_by : String @doc(description: "Default Sort By.") - root_category_id: Int @deprecated(reason: "Use `root_category_uid` instead") @doc(description: "The ID of the root category") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryId") +type StoreConfig { + product_url_suffix : String @doc(description: "The suffix applied to product pages, such as `.htm` or `.html`.") + category_url_suffix : String @doc(description: "The suffix applied to category pages, such as `.htm` or `.html`.") + title_separator : String @doc(description: "The character that separates the category name and subcategory in the browser title bar.") + list_mode : String @doc(description: "The format of the search results list.") + grid_per_page_values : String @doc(description: "A list of numbers that define how many products can be displayed in Grid View.") + list_per_page_values : String @doc(description: "A list of numbers that define how many products can be displayed in List View.") + grid_per_page : Int @doc(description: "The default number of products per page in Grid View.") + list_per_page : Int @doc(description: "The default number of products per page in List View.") + catalog_default_sort_by : String @doc(description: "The default sort order of the search results list.") + root_category_id: Int @deprecated(reason: "Use `root_category_uid` instead.") @doc(description: "The ID of the root category.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryId") root_category_uid: ID @doc(description: "The unique ID for a `CategoryInterface` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\RootCategoryUid") } -type SimpleWishlistItem implements WishlistItemInterface @doc(description: "A simple product wish list Item") { +type SimpleWishlistItem implements WishlistItemInterface @doc(description: "Contains a simple product wish list item.") { } -type VirtualWishlistItem implements WishlistItemInterface @doc(description: "A virtual product wish list item") { +type VirtualWishlistItem implements WishlistItemInterface @doc(description: "Contains a virtual product wish list item.") { } diff --git a/app/code/Magento/CatalogInventoryGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogInventoryGraphQl/etc/schema.graphqls index 6a6c7e75dbd90..bb9ef91c751f0 100644 --- a/app/code/Magento/CatalogInventoryGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogInventoryGraphQl/etc/schema.graphqls @@ -2,11 +2,11 @@ # See COPYING.txt for license details. interface ProductInterface { - only_x_left_in_stock: Float @doc(description: "Product stock only x left count") @resolver(class: "Magento\\CatalogInventoryGraphQl\\Model\\Resolver\\OnlyXLeftInStockResolver") - stock_status: ProductStockStatus @doc(description: "Stock status of the product") @resolver(class: "Magento\\CatalogInventoryGraphQl\\Model\\Resolver\\StockStatusProvider") + only_x_left_in_stock: Float @doc(description: "The value assigned to the Only X Left Threshold option in the Admin.") @resolver(class: "Magento\\CatalogInventoryGraphQl\\Model\\Resolver\\OnlyXLeftInStockResolver") + stock_status: ProductStockStatus @doc(description: "The stock status of the product.") @resolver(class: "Magento\\CatalogInventoryGraphQl\\Model\\Resolver\\StockStatusProvider") } -enum ProductStockStatus @doc(description: "This enumeration states whether a product stock status is in stock or out of stock") { +enum ProductStockStatus @doc(description: "States whether a product stock status is in stock or out of stock.") { IN_STOCK OUT_OF_STOCK } diff --git a/app/code/Magento/CheckoutAgreementsGraphQl/etc/schema.graphqls b/app/code/Magento/CheckoutAgreementsGraphQl/etc/schema.graphqls index 64ef9411dfca6..836d79d3a1d53 100644 --- a/app/code/Magento/CheckoutAgreementsGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CheckoutAgreementsGraphQl/etc/schema.graphqls @@ -2,20 +2,20 @@ # See COPYING.txt for license details. type Query { - checkoutAgreements: [CheckoutAgreement] @resolver(class: "Magento\\CheckoutAgreementsGraphQl\\Model\\Resolver\\CheckoutAgreements") @doc(description: "The Checkout Agreements information") + checkoutAgreements: [CheckoutAgreement] @resolver(class: "Magento\\CheckoutAgreementsGraphQl\\Model\\Resolver\\CheckoutAgreements") @doc(description: "Return Terms and Conditions configuration information.") } -type CheckoutAgreement @doc(description: "Defines all Checkout Agreement information") { - agreement_id: Int! @doc(description: "Checkout Agreement identifier") - name: String! @doc(description: "Checkout Agreement name") - content: String! @doc(description: "Checkout Agreement content") - content_height: String @doc(description: "Checkout Agreement content height") - checkbox_text: String! @doc(description: "Checkout Agreement checkbox text") - is_html: Boolean! @doc(description: "Is Checkout Agreement content in HTML format") - mode: CheckoutAgreementMode! +type CheckoutAgreement @doc(description: "Defines details about an individual checkout agreement.") { + agreement_id: Int! @doc(description: "The ID for a checkout agreement.") + name: String! @doc(description: "The name given to the condition.") + content: String! @doc(description: "Required. The text of the agreement.") + content_height: String @doc(description: "The height of the text box where the Terms and Conditions statement appears during checkout.") + checkbox_text: String! @doc(description: "The checkbox text for the checkout agreement.") + is_html: Boolean! @doc(description: "Indicates whether the `content` text is in HTML format.") + mode: CheckoutAgreementMode! @doc(description: "Indicates whether agreements are accepted automatically or manually.") } -enum CheckoutAgreementMode { - AUTO - MANUAL +enum CheckoutAgreementMode @doc(description: "Indicates how agreements are accepted.") { + AUTO @doc(description: "Conditions are automatically accepted upon checkout.") + MANUAL @doc(description: "Shoppers must manually accept the conditions to place an order.") } diff --git a/app/code/Magento/CmsGraphQl/etc/schema.graphqls b/app/code/Magento/CmsGraphQl/etc/schema.graphqls index 338dae0f6c6c9..b99d3c24cc2d3 100644 --- a/app/code/Magento/CmsGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CmsGraphQl/etc/schema.graphqls @@ -1,43 +1,43 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type StoreConfig @doc(description: "The type contains information about a store config") { - front : String @doc(description: "Default Web URL") - cms_home_page : String @doc(description: "CMS Home Page") - no_route : String @doc(description: "Default No-route URL") - cms_no_route : String @doc(description: "CMS No Route Page") - cms_no_cookies : String @doc(description: "CMS No Cookies Page") - show_cms_breadcrumbs : Int @doc(description: "Show Breadcrumbs for CMS Pages") +type StoreConfig { + front : String @doc(description: "The landing page that is associated with the base URL.") + cms_home_page : String @doc(description: "The name of the CMS page that identifies the home page for the store.") + no_route : String @doc(description: "The default page that displays when a 404 'Page not Found' error occurs.") + cms_no_route : String @doc(description: "A specific CMS page that displays when a 404 'Page Not Found' error occurs.") + cms_no_cookies : String @doc(description: "A specific CMS page that displays when cookies are not enabled for the browser.") + show_cms_breadcrumbs : Int @doc(description: "Indicates whether a breadcrumb trail appears on all CMS pages in the catalog. 0 (No) or 1 (Yes).") } type Query { cmsPage ( - id: Int @doc(description: "Id of the CMS page") @deprecated(reason: "The `id` is deprecated. Use `identifier` instead.") @doc(description: "The CMS page query returns information about a CMS page") - identifier: String @doc(description: "Identifier of the CMS page") - ): CmsPage @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Page") @doc(description: "The CMS page query returns information about a CMS page") @cache(cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Page\\Identity") + id: Int @doc(description: "The ID of the CMS page.") @deprecated(reason: "Use `identifier` instead.") + identifier: String @doc(description: "The identifier of the CMS page.") + ): CmsPage @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Page") @doc(description: "Return details about a CMS page.") @cache(cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Page\\Identity") cmsBlocks ( - identifiers: [String] @doc(description: "Identifiers of the CMS blocks") - ): CmsBlocks @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Blocks") @doc(description: "The CMS block query returns information about CMS blocks") @cache(cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Block\\Identity") + identifiers: [String] @doc(description: "An array of CMS block IDs.") + ): CmsBlocks @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Blocks") @doc(description: "Return information about CMS blocks.") @cache(cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Block\\Identity") } -type CmsPage implements RoutableInterface @doc(description: "CMS page defines all CMS page information") { - identifier: String @doc(description: "Identifier of the CMS page") - url_key: String @doc(description: "URL key of CMS page") - title: String @doc(description: "CMS page title") - content: String @doc(description: "CMS page content") - content_heading: String @doc(description: "CMS page content heading") - page_layout: String @doc(description: "CMS page content heading") - meta_title: String @doc(description: "CMS page meta title") - meta_description: String @doc(description: "CMS page meta description") - meta_keywords: String @doc(description: "CMS page meta keywords") +type CmsPage implements RoutableInterface @doc(description: "Contains details about a CMS page.") { + identifier: String @doc(description: "The ID of a CMS page.") + url_key: String @doc(description: "The URL key of the CMS page, which is often based on the `content_heading`.") + title: String @doc(description: "The name that appears in the breadcrumb trail navigation and in the browser title bar and tab.") + content: String @doc(description: "The content of the CMS page in raw HTML.") + content_heading: String @doc(description: "The heading that displays at the top of the CMS page.") + page_layout: String @doc(description: "The design layout of the page, indicating the number of columns and navigation features used on the page.") + meta_title: String @doc(description: "A page title that is indexed by search engines and appears in search results listings.") + meta_description: String @doc(description: "A brief description of the page for search results listings.") + meta_keywords: String @doc(description: "A brief description of the page for search results listings.") } -type CmsBlocks @doc(description: "CMS blocks information") { - items: [CmsBlock] @doc(description: "An array of CMS blocks") +type CmsBlocks @doc(description: "Contains an array CMS block items.") { + items: [CmsBlock] @doc(description: "An array of CMS blocks.") } -type CmsBlock @doc(description: "CMS block defines all CMS block information") { - identifier: String @doc(description: "CMS block identifier") - title: String @doc(description: "CMS block title") - content: String @doc(description: "CMS block content") +type CmsBlock @doc(description: "Contains details about a specific CMS block.") { + identifier: String @doc(description: "The CMS block identifier.") + title: String @doc(description: "The title assigned to the CMS block.") + content: String @doc(description: "The content of the CMS block in raw HTML.") } diff --git a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls index e533d476ddd59..ff5c368a4238d 100644 --- a/app/code/Magento/CompareListGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CompareListGraphQl/etc/schema.graphqls @@ -1,64 +1,64 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type ComparableItem { - uid: ID! @doc(description: "The unique ID of an item in a compare list") - product: ProductInterface! @doc(description: "Contains details about a product in a compare list") - attributes: [ProductAttribute]! @doc(description: "An array of product attributes that can be used to compare products") +type ComparableItem @doc(description: "Defines an object used to iterate through items for product comparisons.") { + uid: ID! @doc(description: "The unique ID of an item in a compare list.") + product: ProductInterface! @doc(description: "Details about a product in a compare list.") + attributes: [ProductAttribute]! @doc(description: "An array of product attributes that can be used to compare products.") } -type ProductAttribute { +type ProductAttribute @doc(description: "Contains a product attribute code and value.") { code: String! @doc(description: "The unique identifier for a product attribute code.") - value: String! @doc(description:"The display value of the attribute") + value: String! @doc(description:"The display value of the attribute.") } -type ComparableAttribute { - code: String! @doc(description: "An attribute code that is enabled for product comparisons") - label: String! @doc(description: "The label of the attribute code") +type ComparableAttribute @doc(description: "Contains an attribute code that is used for product comparisons.") { + code: String! @doc(description: "An attribute code that is enabled for product comparisons.") + label: String! @doc(description: "The label of the attribute code.") } -type CompareList { - uid: ID! @doc(description: "The unique ID assigned to the compare list") - items: [ComparableItem] @doc(description: "An array of products to compare") - attributes: [ComparableAttribute] @doc(description: "An array of attributes that can be used for comparing products") - item_count: Int! @doc(description: "The number of items in the compare list") +type CompareList @doc(description: "Contains iterable information such as the array of items, the count, and attributes that represent the compare list.") { + uid: ID! @doc(description: "The unique ID assigned to the compare list.") + items: [ComparableItem] @doc(description: "An array of products to compare.") + attributes: [ComparableAttribute] @doc(description: "An array of attributes that can be used for comparing products.") + item_count: Int! @doc(description: "The number of items in the compare list.") } type Customer { - compare_list: CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CustomerCompareList") @doc(description: "The contents of the customer's compare list") + compare_list: CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CustomerCompareList") @doc(description: "The contents of the customer's compare list.") } type Query { - compareList(uid: ID!): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Return products that have been added to the specified compare list") + compareList(uid: ID! @doc(description: "The unique ID of the compare list to be queried.")): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CompareList") @doc(description: "Return products that have been added to the specified compare list.") } type Mutation { - createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Creates a new compare list. The compare list is saved for logged in customers") - addProductsToCompareList(input: AddProductsToCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to the specified compare list") - removeProductsFromCompareList(input: RemoveProductsFromCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from the specified compare list") - assignCompareListToCustomer(uid: ID!): AssignCompareListToCustomerOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign the specified compare list to the logged in customer") - deleteCompareList(uid: ID!): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete the specified compare list") + createCompareList(input: CreateCompareListInput): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\CreateCompareList") @doc(description: "Create a new compare list. The compare list is saved for logged in customers.") + addProductsToCompareList(input: AddProductsToCompareListInput @doc(description: "An input object that defines which products to add to an existing compare list.")): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AddProductsToCompareList") @doc(description: "Add products to the specified compare list.") + removeProductsFromCompareList(input: RemoveProductsFromCompareListInput @doc(description: "An input object that defines which products to remove from a compare list.")): CompareList @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\RemoveProductsFromCompareList") @doc(description: "Remove products from the specified compare list.") + assignCompareListToCustomer(uid: ID! @doc(description: "The unique ID of the compare list to be assigned.")): AssignCompareListToCustomerOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\AssignCompareListToCustomer") @doc(description: "Assign the specified compare list to the logged in customer.") + deleteCompareList(uid: ID! @doc(description: "The unique ID of the compare list to be deleted.")): DeleteCompareListOutput @resolver(class: "\\Magento\\CompareListGraphQl\\Model\\Resolver\\DeleteCompareList") @doc(description: "Delete the specified compare list.") } -input CreateCompareListInput { - products: [ID!] @doc(description: "An array of product IDs to add to the compare list") +input CreateCompareListInput @doc(description: "Contains an array of product IDs to use for creating a compare list.") { + products: [ID!] @doc(description: "An array of product IDs to add to the compare list.") } -input AddProductsToCompareListInput { - uid: ID!, @doc(description: "The unique identifier of the compare list to modify") - products: [ID!]! @doc(description: "An array of product IDs to add to the compare list") +input AddProductsToCompareListInput @doc(description: "Contains products to add to an existing compare list.") { + uid: ID!, @doc(description: "The unique identifier of the compare list to modify.") + products: [ID!]! @doc(description: "An array of product IDs to add to the compare list.") } -input RemoveProductsFromCompareListInput { - uid: ID!, @doc(description: "The unique identifier of the compare list to modify") - products: [ID!]! @doc(description: "An array of product IDs to remove from the compare list") +input RemoveProductsFromCompareListInput @doc(description: "Defines which products to remove from a compare list.") { + uid: ID!, @doc(description: "The unique identifier of the compare list to modify.") + products: [ID!]! @doc(description: "An array of product IDs to remove from the compare list.") } -type DeleteCompareListOutput { - result: Boolean! @doc(description: "Indicates whether the compare list was successfully deleted") +type DeleteCompareListOutput @doc(description: "Contains the results of the request to delete a compare list.") { + result: Boolean! @doc(description: "Indicates whether the compare list was successfully deleted.") } -type AssignCompareListToCustomerOutput { - result: Boolean! - compare_list: CompareList @doc(description: "The contents of the customer's compare list") +type AssignCompareListToCustomerOutput @doc(description: "Contains the results of the request to assign a compare list.") { + result: Boolean! @doc(description: "Indicates whether the compare list was successfully assigned to the customer.") + compare_list: CompareList @doc(description: "The contents of the customer's compare list.") } diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index 03fae0d34525d..a31c7a6362b1f 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -1,112 +1,112 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. type Mutation { - addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\AddConfigurableProductsToCart") + addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput @doc(description: "An input object that defines which configurable products to add to the cart.")): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\AddConfigurableProductsToCart") @doc(description: "Add one or more configurable products to the specified cart. We recommend using `addProductsToCart` instead.") } -type ConfigurableProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") { - variants: [ConfigurableVariant] @doc(description: "An array of variants of products") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant") - configurable_options: [ConfigurableProductOptions] @doc(description: "An array of linked simple product items") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Options") - configurable_product_options_selection(configurableOptionValueUids: [ID!]): ConfigurableProductOptionsSelection @doc(description: "Specified configurable product options selection") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\OptionsSelectionMetadata") +type ConfigurableProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines basic features of a configurable product and its simple product variants.") { + variants: [ConfigurableVariant] @doc(description: "An array of simple product variants.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant") + configurable_options: [ConfigurableProductOptions] @doc(description: "An array of options for the configurable product.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Options") + configurable_product_options_selection(configurableOptionValueUids: [ID!]): ConfigurableProductOptionsSelection @doc(description: "An array of media gallery items and other details about selected configurable product options as well as details about remaining selectable options.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\OptionsSelectionMetadata") } -type ConfigurableVariant @doc(description: "An array containing all the simple product variants of a configurable product") { - attributes: [ConfigurableAttributeOption] @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes") @doc(description: "") - product: SimpleProduct @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") +type ConfigurableVariant @doc(description: "Contains all the simple product variants of a configurable product.") { + attributes: [ConfigurableAttributeOption] @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes") @doc(description: "An array of configurable attribute options.") + product: SimpleProduct @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") @doc(description: "An array of linked simple products.") } -type ConfigurableAttributeOption @doc(description: "ConfigurableAttributeOption contains the value_index (and other related information) assigned to a configurable product option") { - label: String @doc(description: "A string that describes the configurable attribute option") - code: String @doc(description: "The ID assigned to the attribute") - value_index: Int @doc(description: "A unique index number assigned to the configurable product option") - uid: ID! @doc(description: "The unique ID for a `ConfigurableAttributeOption` object") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") +type ConfigurableAttributeOption @doc(description: "Contains details about a configurable product attribute option.") { + label: String @doc(description: "A string that describes the configurable attribute option.") + code: String @doc(description: "The ID assigned to the attribute.") + value_index: Int @doc(description: "A unique index number assigned to the configurable product option.") + uid: ID! @doc(description: "The unique ID for a `ConfigurableAttributeOption` object.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") } -type ConfigurableProductOptions @doc(description: "ConfigurableProductOptions defines configurable attributes for the specified product") { - id: Int @deprecated(reason: "Use uid instead") @doc(description: "The configurable option ID number assigned by the system") - uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptions` object") - attribute_id: String @deprecated(reason: "Use attribute_uid instead") @doc(description: "The ID assigned to the attribute") - attribute_id_v2: Int @deprecated(reason: "Use attribute_uid instead") @doc(description: "The ID assigned to the attribute") - attribute_uid: ID! @doc(description: "The unique ID for a `Attribute` object") - attribute_code: String @doc(description: "A string that identifies the attribute") - label: String @doc(description: "A string that describes the configurable product option, which is displayed on the UI") - position: Int @doc(description: "A number that indicates the order in which the attribute is displayed") - use_default: Boolean @doc(description: "Indicates whether the option is the default") - values: [ConfigurableProductOptionsValues] @doc(description: "An array that defines the value_index codes assigned to the configurable product") - product_id: Int @deprecated(reason: "`product_id` is not needed and can be obtained from it's parent") @doc(description: "This is the same as a product's id field") +type ConfigurableProductOptions @doc(description: "Defines configurable attributes for the specified product.") { + id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The configurable option ID number assigned by the system.") + uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptions` object.") + attribute_id: String @deprecated(reason: "Use `attribute_uid` instead.") @doc(description: "The ID assigned to the attribute.") + attribute_id_v2: Int @deprecated(reason: "Use `attribute_uid` instead.") @doc(description: "The ID assigned to the attribute.") + attribute_uid: ID! @doc(description: "The unique ID for an `Attribute` object.") + attribute_code: String @doc(description: "A string that identifies the attribute.") + label: String @doc(description: "A displayed string that describes the configurable product option.") + position: Int @doc(description: "A number that indicates the order in which the attribute is displayed.") + use_default: Boolean @doc(description: "Indicates whether the option is the default.") + values: [ConfigurableProductOptionsValues] @doc(description: "An array that defines the `value_index` codes assigned to the configurable product.") + product_id: Int @deprecated(reason: "`product_id` is not needed and can be obtained from its parent.") @doc(description: "This is the same as a product's `id` field.") } -type ConfigurableProductOptionsValues @doc(description: "ConfigurableProductOptionsValues contains the index number assigned to a configurable product option") { - value_index: Int @deprecated(reason: "Use `uid` instead") @doc(description: "A unique index number assigned to the configurable product option") - uid: ID @doc(description: "The unique ID for a `ConfigurableProductOptionsValues` object") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") - label: String @doc(description: "The label of the product") - default_label: String @doc(description: "The label of the product on the default store") - store_label: String @doc(description: "The label of the product on the current store") - use_default_value: Boolean @doc(description: "Indicates whether to use the default_label") +type ConfigurableProductOptionsValues @doc(description: "Contains the index number assigned to a configurable product option.") { + value_index: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "A unique index number assigned to the configurable product option.") + uid: ID @doc(description: "The unique ID for a `ConfigurableProductOptionsValues` object.") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Attributes\\ConfigurableAttributeUid") + label: String @doc(description: "The label of the product.") + default_label: String @doc(description: "The label of the product on the default store.") + store_label: String @doc(description: "The label of the product on the current store.") + use_default_value: Boolean @doc(description: "Indicates whether to use the default_label.") } -input AddConfigurableProductsToCartInput { - cart_id: String! - cart_items: [ConfigurableProductCartItemInput!]! +input AddConfigurableProductsToCartInput @doc(description: "Defines the configurable products to add to the cart.") { + cart_id: String! @doc(description: "The ID of the cart.") + cart_items: [ConfigurableProductCartItemInput!]! @doc(description: "An array of configurable products to add.") } -type AddConfigurableProductsToCartOutput { - cart: Cart! +type AddConfigurableProductsToCartOutput @doc(description: "Contains details about the cart after adding configurable products.") { + cart: Cart! @doc(description: "The cart after adding products.") } input ConfigurableProductCartItemInput { - data: CartItemInput! - variant_sku: String @doc(description: "Deprecated. Use CartItemInput.sku instead.") - parent_sku: String @doc(description: "Configurable product SKU.") - customizable_options:[CustomizableOptionInput!] + data: CartItemInput! @doc(description: "The quantity and SKU of the configurable product.") + variant_sku: String @doc(description: "Deprecated. Use `CartItemInput.sku` instead.") + parent_sku: String @doc(description: "The SKU of the parent configurable product.") + customizable_options:[CustomizableOptionInput!] @doc(description: "The ID and value of the option.") } -type ConfigurableCartItem implements CartItemInterface { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") - configurable_options: [SelectedConfigurableOption!]! @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableCartItemOptions") - configured_variant: ProductInterface! @doc(description: "Product details of the cart item") @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ProductResolver") +type ConfigurableCartItem implements CartItemInterface @doc(description: "An implementation for configurable product cart items.") { + customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing the customizable options the shopper selected.") + configurable_options: [SelectedConfigurableOption!]! @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableCartItemOptions") @doc(description: "An array containing the configuranle options the shopper selected.") + configured_variant: ProductInterface! @doc(description: "Product details of the cart item.") @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ProductResolver") } -type SelectedConfigurableOption { - id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_uid instead") - configurable_product_option_uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptions` object") - option_label: String! - value_id: Int! @deprecated(reason: "Use SelectedConfigurableOption.configurable_product_option_value_uid instead") - configurable_product_option_value_uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptionsValues` object") - value_label: String! +type SelectedConfigurableOption @doc(description: "Contains details about a selected configurable option.") { + id: Int! @deprecated(reason: "Use `SelectedConfigurableOption.configurable_product_option_uid` instead.") + configurable_product_option_uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptions` object.") + option_label: String! @doc(description: "The display text for the option.") + value_id: Int! @deprecated(reason: "Use `SelectedConfigurableOption.configurable_product_option_value_uid` instead.") + configurable_product_option_value_uid: ID! @doc(description: "The unique ID for a `ConfigurableProductOptionsValues` object.") + value_label: String! @doc(description: "The display name of the selected configurable option.") } -type ConfigurableWishlistItem implements WishlistItemInterface @doc(description: "A configurable product wish list item"){ - child_sku: String! @doc(description: "The SKU of the simple product corresponding to a set of selected configurable options") @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Wishlist\\ChildSku") - configurable_options: [SelectedConfigurableOption!] @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Wishlist\\ConfigurableOptions") @doc (description: "An array of selected configurable options") +type ConfigurableWishlistItem implements WishlistItemInterface @doc(description: "A configurable product wish list item."){ + child_sku: String! @doc(description: "The SKU of the simple product corresponding to a set of selected configurable options.") @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Wishlist\\ChildSku") + configurable_options: [SelectedConfigurableOption!] @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Wishlist\\ConfigurableOptions") @doc(description: "An array of selected configurable options.") } -type ConfigurableProductOptionsSelection @doc(description: "Metadata corresponding to the configurable options selection.") { - options_available_for_selection: [ConfigurableOptionAvailableForSelection!] @doc(description: "Configurable options available for further selection based on current selection.") - configurable_options: [ConfigurableProductOption!] @doc(description: "Configurable options available for further selection based on current selection.") +type ConfigurableProductOptionsSelection @doc(description: "Contains metadata corresponding to the selected configurable options.") { + options_available_for_selection: [ConfigurableOptionAvailableForSelection!] @doc(description: "The configurable options available for further selection based on the current selection.") + configurable_options: [ConfigurableProductOption!] @doc(description: "An array of all possible configurable options.") media_gallery: [MediaGalleryInterface!] @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\SelectionMediaGallery") @doc(description: "Product images and videos corresponding to the specified configurable options selection.") - variant: SimpleProduct @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Variant") @doc(description: "Variant represented by the specified configurable options selection. It is expected to be null, until selections are made for each configurable option.") + variant: SimpleProduct @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Variant") @doc(description: "A variant represented by the specified configurable options selection. The value is expected to be null until selections are made for each configurable option.") } -type ConfigurableOptionAvailableForSelection @doc(description: "Configurable option available for further selection based on current selection.") { - option_value_uids: [ID!]! @doc(description: "Configurable option values available for further selection.") - attribute_code: String! @doc(description: "Attribute code that uniquely identifies configurable option.") +type ConfigurableOptionAvailableForSelection @doc(description: "Describes configurable options that have been selected and can be selected as a result of the previous selections.") { + option_value_uids: [ID!]! @doc(description: "An array of selectable option value IDs.") + attribute_code: String! @doc(description: "An attribute code that uniquely identifies a configurable option.") } -type ConfigurableProductOption { - uid: ID! - attribute_code: String! - label: String! - values: [ConfigurableProductOptionValue!] +type ConfigurableProductOption @doc(description: "Contains details about configurable product options.") { + uid: ID! @doc(description: "The unique ID of the configurable option.") + attribute_code: String! @doc(description: "An attribute code that uniquely identifies a configurable option.") + label: String! @doc(description: "The display name of the option.") + values: [ConfigurableProductOptionValue!] @doc(description: "An array of values that are applicable for this option.") } -type ConfigurableProductOptionValue { - uid: ID! - is_available: Boolean! - is_use_default: Boolean! - label: String! +type ConfigurableProductOptionValue @doc(description: "Defines a value for a configurable product option.") { + uid: ID! @doc(description: "The unique ID of the value.") + is_available: Boolean! @doc(description: "Indicates whether the product is available with this selected option.") + is_use_default: Boolean! @doc(description: "Indicates whether the value is the default.") + label: String! @doc(description: "The display name of the value.") } -type StoreConfig @doc(description: "The type contains information about a store config") { - configurable_thumbnail_source : String @doc(description: "The configuration setting determines which thumbnail should be used in the cart for configurable products.") +type StoreConfig { + configurable_thumbnail_source : String @doc(description: "Indicates whether the `parent` or child (`itself`) thumbnail should be used in the cart for configurable products.") } diff --git a/app/code/Magento/CustomerDownloadableGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerDownloadableGraphQl/etc/schema.graphqls index 5ff0dc664ff74..8754b2a33920f 100644 --- a/app/code/Magento/CustomerDownloadableGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerDownloadableGraphQl/etc/schema.graphqls @@ -2,17 +2,17 @@ # See COPYING.txt for license details. type Query { - customerDownloadableProducts: CustomerDownloadableProducts @resolver(class: "Magento\\CustomerDownloadableGraphQl\\Model\\Resolver\\CustomerDownloadableProducts") @doc(description: "The query returns the contents of a customer's downloadable products") @cache(cacheable: false) + customerDownloadableProducts: CustomerDownloadableProducts @resolver(class: "Magento\\CustomerDownloadableGraphQl\\Model\\Resolver\\CustomerDownloadableProducts") @doc(description: "Return a list of downloadable products the customer has purchased.") @cache(cacheable: false) } -type CustomerDownloadableProducts { - items: [CustomerDownloadableProduct] @doc(description: "List of purchased downloadable items") +type CustomerDownloadableProducts @doc(description: "Contains a list of downloadable products.") { + items: [CustomerDownloadableProduct] @doc(description: "An array of purchased downloadable items.") } -type CustomerDownloadableProduct { - order_increment_id: String - date: String - status: String - download_url: String - remaining_downloads: String +type CustomerDownloadableProduct @doc(description: "Contains details about a single downloadable product.") { + order_increment_id: String @doc(description: "The unique ID assigned to the item.") + date: String @doc(description: "The date and time the purchase was made.") + status: String @doc(description: "Indicates when the product becomes available for download. Options are `Pending` and `Invoiced`.") + download_url: String @doc(description: "The fully qualified URL to the download file.") + remaining_downloads: String @doc(description: "The remaining number of times the customer can download the product.") } diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls index 5eed9a38a0350..d178a6b3cf242 100644 --- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls @@ -2,182 +2,182 @@ # See COPYING.txt for license details. type StoreConfig { - required_character_classes_number : String @doc(description: "The number of different character classes required in a password (lowercase, uppercase, digits, special characters).") + required_character_classes_number : String @doc(description: "The number of different character classes (lowercase, uppercase, digits, special characters) required in a password.") minimum_password_length : String @doc(description: "The minimum number of characters required for a valid password.") - autocomplete_on_storefront : Boolean @doc(description: "Enable autocomplete on login and forgot password forms") + autocomplete_on_storefront : Boolean @doc(description: "Indicates whether to enable autocomplete on login and forgot password forms.") } type Query { - customer: Customer @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\Customer") @doc(description: "The customer query returns information about a customer account") @cache(cacheable: false) + customer: Customer @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\Customer") @doc(description: "Return detailed information about a customer account.") @cache(cacheable: false) isEmailAvailable ( - email: String! @doc(description: "The new customer email") - ): IsEmailAvailableOutput @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\IsEmailAvailable") + email: String! @doc(description: "The email address to check.") + ): IsEmailAvailableOutput @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\IsEmailAvailable") @doc(description: "Check whether the specified email has already been used to create a customer account.") } type Mutation { - generateCustomerToken(email: String!, password: String!): CustomerToken @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\GenerateCustomerToken") @doc(description:"Retrieve the customer token") - changeCustomerPassword(currentPassword: String!, newPassword: String!): Customer @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ChangePassword") @doc(description:"Changes the password for the logged-in customer") - createCustomer (input: CustomerInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomer") @doc(description:"Create customer account") - createCustomerV2 (input: CustomerCreateInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomer") @doc(description:"Create customer account") - updateCustomer (input: CustomerInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Deprecated. Use UpdateCustomerV2 instead.") - updateCustomerV2 (input: CustomerUpdateInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update the customer's personal information") - revokeCustomerToken: RevokeCustomerTokenOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RevokeCustomerToken") @doc(description:"Revoke the customer token") - createCustomerAddress(input: CustomerAddressInput!): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomerAddress") @doc(description: "Create customer address") - updateCustomerAddress(id: Int!, input: CustomerAddressInput): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update customer address") - deleteCustomerAddress(id: Int!): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete customer address") - requestPasswordResetEmail(email: String!): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RequestPasswordResetEmail") @doc(description: "Request an email with a reset password token for the registered customer identified by the specified email.") - resetPassword(email: String!, resetPasswordToken: String!, newPassword: String!): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ResetPassword") @doc(description: "Reset a customer's password using the reset password token that the customer received in an email after requesting it using requestPasswordResetEmail.") - updateCustomerEmail(email: String!, password: String!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerEmail") @doc(description: "") + generateCustomerToken(email: String! @doc(description: "The customer's email address."), password: String! @doc(description: "The customer's password.")): CustomerToken @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\GenerateCustomerToken") @doc(description:"Generate a token for specified customer.") + changeCustomerPassword(currentPassword: String! @doc(description: "The customer's original password."), newPassword: String! @doc(description: "The customer's updated password.")): Customer @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ChangePassword") @doc(description:"Change the password for the logged-in customer.") + createCustomer (input: CustomerInput! @doc(description: "An input object that defines the customer to be created.")): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomer") @doc(description:"Use `createCustomerV2` instead.") + createCustomerV2 (input: CustomerCreateInput! @doc(description: "An input object that defines the customer to be created.")): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomer") @doc(description:"Create a customer account.") + updateCustomer (input: CustomerInput! @doc(description: "An input object that defines the customer characteristics to update.")): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Use `updateCustomerV2` instead.") + updateCustomerV2 (input: CustomerUpdateInput! @doc(description: "An input object that defines the customer characteristics to update.")): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update the customer's personal information.") + revokeCustomerToken: RevokeCustomerTokenOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RevokeCustomerToken") @doc(description:"Revoke the customer token.") + createCustomerAddress(input: CustomerAddressInput!): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomerAddress") @doc(description: "Create a billing or shipping address for a customer or guest.") + updateCustomerAddress(id: Int! @doc(description: "The ID assigned to the customer address."), input: CustomerAddressInput @doc(description: "An input object that contains changes to the customer address.")): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update the billing or shipping address of a customer or guest.") + deleteCustomerAddress(id: Int! @doc(description: "The ID of the customer address to be deleted.")): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete the billing or shipping address of a customer.") + requestPasswordResetEmail(email: String! @doc(description: "The customer's email address.")): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RequestPasswordResetEmail") @doc(description: "Request an email with a reset password token for the registered customer identified by the specified email.") + resetPassword(email: String! @doc(description: "The customer's email address."), resetPasswordToken: String! @doc(description: "A runtime token generated by the `requestPasswordResetEmail` mutation."), newPassword: String! @doc(description: "The customer's new password.")): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ResetPassword") @doc(description: "Reset a customer's password using the reset password token that the customer received in an email after requesting it using `requestPasswordResetEmail`.") + updateCustomerEmail(email: String! @doc(description: "The customer's email address."), password: String! @doc(description: "The customer's password.")): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerEmail") @doc(description: "Change the email address for the logged-in customer.") } -input CustomerAddressInput { - firstname: String @doc(description: "The first name of the person associated with the shipping/billing address") - lastname: String @doc(description: "The family name of the person associated with the shipping/billing address") - company: String @doc(description: "The customer's company") - telephone: String @doc(description: "The telephone number") - street: [String] @doc(description: "An array of strings that define the street number and name") - city: String @doc(description: "The city or town") - region: CustomerAddressRegionInput @doc(description: "An object containing the region name, region code, and region ID") - postcode: String @doc(description: "The customer's ZIP or postal code") +input CustomerAddressInput @doc(description: "Contains details about a billing or shipping address."){ + firstname: String @doc(description: "The first name of the person associated with the billing/shipping address.") + lastname: String @doc(description: "The family name of the person associated with the billing/shipping address.") + company: String @doc(description: "The customer's company.") + telephone: String @doc(description: "The customer's telephone number.") + street: [String] @doc(description: "An array of strings that define the street number and name.") + city: String @doc(description: "The customer's city or town.") + region: CustomerAddressRegionInput @doc(description: "An object containing the region name, region code, and region ID.") + postcode: String @doc(description: "The customer's ZIP or postal code.") country_id: CountryCodeEnum @doc(description: "Deprecated: use `country_code` instead.") - country_code: CountryCodeEnum @doc(description: "The customer's country") - default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address") - default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address") - fax: String @doc(description: "The fax number") - middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address") + country_code: CountryCodeEnum @doc(description: "The two-letter code representing the customer's country.") + default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address.") + default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address.") + fax: String @doc(description: "The customer's fax number.") + middlename: String @doc(description: "The middle name of the person associated with the billing/shipping address.") prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - vat_id: String @doc(description: "The customer's Tax/VAT number (for corporate customers)") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + vat_id: String @doc(description: "The customer's Tax/VAT number (for corporate customers).") custom_attributes: [CustomerAddressAttributeInput] @doc(description: "Deprecated: Custom attributes should not be put into container.") } -input CustomerAddressRegionInput @doc(description: "CustomerAddressRegionInput defines the customer's state or province") { - region_code: String @doc(description: "The address region code") - region: String @doc(description: "The state or province name") - region_id: Int @doc(description: "The unique ID for a pre-defined region") +input CustomerAddressRegionInput @doc(description: "Defines the customer's state or province.") { + region_code: String @doc(description: "The address region code.") + region: String @doc(description: "The state or province name.") + region_id: Int @doc(description: "The unique ID for a pre-defined region.") } -input CustomerAddressAttributeInput { - attribute_code: String! @doc(description: "Attribute code") - value: String! @doc(description: "Attribute value") +input CustomerAddressAttributeInput @doc(description: "Specifies the attribute code and value of a customer attribute.") { + attribute_code: String! @doc(description: "The name assigned to the attribute.") + value: String! @doc(description: "The value assigned to the attribute.") } -type CustomerToken { - token: String @doc(description: "The customer token") +type CustomerToken @doc(description: "Contains a customer authorization token.") { + token: String @doc(description: "The customer authorization token.") } -input CustomerInput { +input CustomerInput @doc(description: "An input object that assigns or updates customer attributes.") { prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - firstname: String @doc(description: "The customer's first name") - middlename: String @doc(description: "The customer's middle name") - lastname: String @doc(description: "The customer's family name") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - email: String @doc(description: "The customer's email address. Required for customer creation") - dob: String @doc(description: "Deprecated: Use `date_of_birth` instead") - date_of_birth: String @doc(description: "The customer's date of birth") - taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)") - gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") - password: String @doc(description: "The customer's password") - is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") + firstname: String @doc(description: "The customer's first name.") + middlename: String @doc(description: "The customer's middle name.") + lastname: String @doc(description: "The customer's family name.") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + email: String @doc(description: "The customer's email address. Required when creating a customer.") + dob: String @doc(description: "Deprecated: Use `date_of_birth` instead.") + date_of_birth: String @doc(description: "The customer's date of birth.") + taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers).") + gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2).") + password: String @doc(description: "The customer's password.") + is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") } -input CustomerCreateInput { +input CustomerCreateInput @doc(description: "An input object for creating a customer.") { prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - firstname: String! @doc(description: "The customer's first name") - middlename: String @doc(description: "The customer's middle name") - lastname: String! @doc(description: "The customer's family name") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - email: String! @doc(description: "The customer's email address. Required for customer creation") - dob: String @doc(description: "Deprecated: Use `date_of_birth` instead") - date_of_birth: String @doc(description: "The customer's date of birth") - taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)") - gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") - password: String @doc(description: "The customer's password") - is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") + firstname: String! @doc(description: "The customer's first name.") + middlename: String @doc(description: "The customer's middle name.") + lastname: String! @doc(description: "The customer's family name.") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + email: String! @doc(description: "The customer's email address.") + dob: String @doc(description: "Deprecated: Use `date_of_birth` instead.") + date_of_birth: String @doc(description: "The customer's date of birth.") + taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers).") + gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2).") + password: String @doc(description: "The customer's password.") + is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") } -input CustomerUpdateInput { - date_of_birth: String @doc(description: "The customer's date of birth") - dob: String @doc(description: "Deprecated: Use `date_of_birth` instead") - firstname: String @doc(description: "The customer's first name") - gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") - is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") - lastname: String @doc(description: "The customer's family name") - middlename: String @doc(description: "The customer's middle name") +input CustomerUpdateInput @doc(description: "An input object for updating a customer.") { + date_of_birth: String @doc(description: "The customer's date of birth.") + dob: String @doc(description: "Deprecated: Use `date_of_birth` instead.") + firstname: String @doc(description: "The customer's first name.") + gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2).") + is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") + lastname: String @doc(description: "The customer's family name.") + middlename: String @doc(description: "The customer's middle name.") prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers).") } -type CustomerOutput { - customer: Customer! +type CustomerOutput @doc(description: "Contains details about a newly-created or updated customer.") { + customer: Customer! @doc(description: "Customer details after creating or updating a customer.") } -type RevokeCustomerTokenOutput { - result: Boolean! +type RevokeCustomerTokenOutput @doc(description: "Contains the result of a request to revoke a customer token.") { + result: Boolean! @doc(description: "The result of a request to revoke a customer token.") } -type Customer @doc(description: "Customer defines the customer name and address and other details") { - created_at: String @doc(description: "Timestamp indicating when the account was created") - group_id: Int @deprecated(reason: "Customer group should not be exposed in the storefront scenarios") +type Customer @doc(description: "Defines the customer name, addresses, and other details.") { + created_at: String @doc(description: "Timestamp indicating when the account was created.") + group_id: Int @deprecated(reason: "Customer group should not be exposed in the storefront scenarios.") prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - firstname: String @doc(description: "The customer's first name") - middlename: String @doc(description: "The customer's middle name") - lastname: String @doc(description: "The customer's family name") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - email: String @doc(description: "The customer's email address. Required") - default_billing: String @doc(description: "The ID assigned to the billing address") - default_shipping: String @doc(description: "The ID assigned to the shipping address") - dob: String @doc(description: "The customer's date of birth") @deprecated(reason: "Use `date_of_birth` instead") - date_of_birth: String @doc(description: "The customer's date of birth") - taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") - id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.") - is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed") - addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") - gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)") + firstname: String @doc(description: "The customer's first name.") + middlename: String @doc(description: "The customer's middle name.") + lastname: String @doc(description: "The customer's family name.") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + email: String @doc(description: "The customer's email address. Required.") + default_billing: String @doc(description: "The ID assigned to the billing address.") + default_shipping: String @doc(description: "The ID assigned to the shipping address.") + dob: String @doc(description: "The customer's date of birth.") @deprecated(reason: "Use `date_of_birth` instead.") + date_of_birth: String @doc(description: "The customer's date of birth.") + taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers).") + id: Int @doc(description: "The ID assigned to the customer.") @deprecated(reason: "`id` is not needed as part of `Customer`, because on the server side, it can be identified based on the customer token used for authentication. There is no need to know customer ID on the client side.") + is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed") + addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses.") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses") + gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2).") } -type CustomerAddress @doc(description: "CustomerAddress contains detailed information about a customer's billing and shipping addresses"){ - id: Int @doc(description: "The ID assigned to the address object") - customer_id: Int @doc(description: "The customer ID") @deprecated(reason: "customer_id is not needed as part of CustomerAddress, address ID (id) is unique identifier for the addresses.") - region: CustomerAddressRegion @doc(description: "An object containing the region name, region code, and region ID") - region_id: Int @doc(description: "The unique ID for a pre-defined region") - country_id: String @doc(description: "The customer's country") @deprecated(reason: "Use `country_code` instead.") - country_code: CountryCodeEnum @doc(description: "The customer's country") - street: [String] @doc(description: "An array of strings that define the street number and name") - company: String @doc(description: "The customer's company") - telephone: String @doc(description: "The telephone number") - fax: String @doc(description: "The fax number") - postcode: String @doc(description: "The customer's ZIP or postal code") - city: String @doc(description: "The city or town") - firstname: String @doc(description: "The first name of the person associated with the shipping/billing address") - lastname: String @doc(description: "The family name of the person associated with the shipping/billing address") - middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address") +type CustomerAddress @doc(description: "Contains detailed information about a customer's billing or shipping address."){ + id: Int @doc(description: "The ID of a `CustomerAddress` object.") + customer_id: Int @doc(description: "The customer ID") @deprecated(reason: "`customer_id` is not needed as part of `CustomerAddress`. The `id` is a unique identifier for the addresses.") + region: CustomerAddressRegion @doc(description: "An object containing the region name, region code, and region ID.") + region_id: Int @doc(description: "The unique ID for a pre-defined region.") + country_id: String @doc(description: "The customer's country.") @deprecated(reason: "Use `country_code` instead.") + country_code: CountryCodeEnum @doc(description: "The customer's country.") + street: [String] @doc(description: "An array of strings that define the street number and name.") + company: String @doc(description: "The customer's company.") + telephone: String @doc(description: "The customer's telephone number.") + fax: String @doc(description: "The customer's fax number.") + postcode: String @doc(description: "The customer's ZIP or postal code.") + city: String @doc(description: "The customer's city or town.") + firstname: String @doc(description: "The first name of the person associated with the shipping/billing address.") + lastname: String @doc(description: "The family name of the person associated with the shipping/billing address.") + middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address.") prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") - default_shipping: Boolean @doc(description: "Indicates whether the address is the default shipping address") - default_billing: Boolean @doc(description: "Indicates whether the address is the default billing address") - custom_attributes: [CustomerAddressAttribute] @deprecated(reason: "Custom attributes should not be put into container") - extension_attributes: [CustomerAddressAttribute] @doc(description: "Address extension attributes") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers).") + default_shipping: Boolean @doc(description: "Indicates whether the address is the customer's default shipping address.") + default_billing: Boolean @doc(description: "Indicates whether the address is the customer's default billing address.") + custom_attributes: [CustomerAddressAttribute] @deprecated(reason: "Custom attributes should not be put into a container.") + extension_attributes: [CustomerAddressAttribute] @doc(description: "Contains any extension attributes for the address.") } -type CustomerAddressRegion @doc(description: "CustomerAddressRegion defines the customer's state or province") { - region_code: String @doc(description: "The address region code") - region: String @doc(description: "The state or province name") - region_id: Int @doc(description: "The unique ID for a pre-defined region") +type CustomerAddressRegion @doc(description: "Defines the customer's state or province.") { + region_code: String @doc(description: "The address region code.") + region: String @doc(description: "The state or province name.") + region_id: Int @doc(description: "The unique ID for a pre-defined region.") } -type CustomerAddressAttribute { - attribute_code: String @doc(description: "Attribute code") - value: String @doc(description: "Attribute value") +type CustomerAddressAttribute @doc(description: "Specifies the attribute code and value of a customer address attribute.") { + attribute_code: String @doc(description: "The name assigned to the customer address attribute.") + value: String @doc(description: "The valuue assigned to the customer address attribute.") } -type IsEmailAvailableOutput { - is_email_available: Boolean @doc(description: "Is email availabel value") +type IsEmailAvailableOutput @doc(description: "Contains the result of the `isEmailAvailable` query.") { + is_email_available: Boolean @doc(description: "Indicates whether the specified email address can be used to create a customer.") } -enum CountryCodeEnum @doc(description: "The list of countries codes") { +enum CountryCodeEnum @doc(description: "The list of country codes.") { AF @doc(description: "Afghanistan") AX @doc(description: "Åland Islands") AL @doc(description: "Albania") diff --git a/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls b/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls index 06d7d4817ee02..ed16732f3dcc5 100644 --- a/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls +++ b/app/code/Magento/DirectoryGraphQl/etc/schema.graphqls @@ -2,38 +2,38 @@ # See COPYING.txt for license details. type Query { - currency: Currency @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Currency") @doc(description: "The currency query returns information about store currency.") @cache(cacheable: false) + currency: Currency @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Currency") @doc(description: "Return information about the store's currency.") @cache(cacheable: false) countries: [Country] @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Countries") @doc(description: "The countries query provides information for all countries.") @cache(cacheable: false) country (id: String): Country @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Country") @doc(description: "The countries query provides information for a single country.") @cache(cacheable: false) } type Currency { - base_currency_code: String - base_currency_symbol: String + base_currency_code: String @doc(description: "The base currency set for the store, such as USD.") + base_currency_symbol: String @doc(description: "The symbol for the specified base currency, such as $.") default_display_currecy_code: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_code`.") - default_display_currency_code: String - default_display_currecy_symbol: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_symbol`.") - default_display_currency_symbol: String - available_currency_codes: [String] - exchange_rates: [ExchangeRate] + default_display_currency_code: String @doc(description: "The currency that is displayed by default, such as USD.") + default_display_currecy_symbol: String @deprecated(reason: "Symbol was missed. Use `default_display_currency_code`.") + default_display_currency_symbol: String @doc(description: "The currency symbol that is displayed by default, such as $.") + available_currency_codes: [String] @doc(description: "An array of three-letter currency codes accepted by the store, such as USD and EUR.") + exchange_rates: [ExchangeRate] @doc(description: "An array of exchange rates for currencies defined in the store.") } -type ExchangeRate { - currency_to: String - rate: Float +type ExchangeRate @doc(description: "Lists the exchange rate.") { + currency_to: String @doc(description: "Specifies the store’s default currency to exchange to.") + rate: Float @doc(description: "The exchange rate for the store’s default currency.") } type Country { id: String @doc(description: "The unique ID for a `Country` object.") - two_letter_abbreviation: String - three_letter_abbreviation: String - full_name_locale: String - full_name_english: String - available_regions: [Region] + two_letter_abbreviation: String @doc(description: "The two-letter abbreviation of the country, such as US.") + three_letter_abbreviation: String @doc(description: "The three-letter abbreviation of the country, such as USA.") + full_name_locale: String @doc(description: "The name of the country in the current locale.") + full_name_english: String @doc(description: "The name of the country in English.") + available_regions: [Region] @doc(description: "An array of regions within a particular country.") } type Region { id: Int @doc(description: "The unique ID for a `Region` object.") - code: String - name: String + code: String @doc(description: "The two-letter code for the region, such as TX for Texas.") + name: String @doc(description: "The name of the region, such as Texas.") } diff --git a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls index 1c552dc858e92..ad24ed4692079 100644 --- a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls +++ b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls @@ -2,39 +2,39 @@ # See COPYING.txt for license details. type Mutation { - addDownloadableProductsToCart(input: AddDownloadableProductsToCartInput): AddDownloadableProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") + addDownloadableProductsToCart(input: AddDownloadableProductsToCartInput @doc(description: "An input object that defines which downloadable products to add to the cart.")): AddDownloadableProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description: "Add one or more downloadable products to the specified cart. We recommend using `addProductsToCart` instead.") } input AddDownloadableProductsToCartInput { - cart_id: String! - cart_items: [DownloadableProductCartItemInput!]! + cart_id: String! @doc(description: "The ID of the cart.") + cart_items: [DownloadableProductCartItemInput!]! @doc(description: "An array of downloadable products to add.") } -input DownloadableProductCartItemInput { - data: CartItemInput! - downloadable_product_links: [DownloadableProductLinksInput!] - customizable_options:[CustomizableOptionInput!] +input DownloadableProductCartItemInput @doc(description: "Defines a single downloadable product.") { + data: CartItemInput! @doc(description: "The quantity and SKU of the downloadable product.") + downloadable_product_links: [DownloadableProductLinksInput!] @doc(description: "An array of objects containing the link_id of the downloadable product link.") + customizable_options:[CustomizableOptionInput!] @doc(description: "The ID and value of the option.") } -input DownloadableProductLinksInput { - link_id: Int! +input DownloadableProductLinksInput @doc(description: "Contains the link ID for the downloadable product.") { + link_id: Int! @doc(description: "The unique ID of the downloadable product link.") } -type AddDownloadableProductsToCartOutput { - cart: Cart! +type AddDownloadableProductsToCartOutput @doc(description: "Contains details about the cart after adding downloadable products.") { + cart: Cart! @doc(description: "The cart after adding products.") } -type DownloadableCartItem implements CartItemInterface @doc(description: "Downloadable Cart Item") { - customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") - links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Links") @doc(description: "An array containing information about the links for the added to cart downloadable product") - samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Samples") @doc(description: "DownloadableProductSamples defines characteristics of a downloadable product") +type DownloadableCartItem implements CartItemInterface @doc(description: "An implementation for downloadable product cart items.") { + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing the customizable options the shopper selected.") + links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Links") @doc(description: "An array containing information about the links for the downloadable product added to the cart.") + samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Samples") @doc(description: "An array containing information about samples of the selected downloadable product.") } -type DownloadableProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "DownloadableProduct defines a product that the shopper downloads") { +type DownloadableProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "Defines a product that the shopper downloads.") { downloadable_product_samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Samples") @doc(description: "An array containing information about samples of this downloadable product.") - downloadable_product_links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Links") @doc(description: "An array containing information about the links for this downloadable product") - links_purchased_separately: Int @doc(description: "A value of 1 indicates that each link in the array must be purchased separately") - links_title: String @doc(description: "The heading above the list of downloadable products") + downloadable_product_links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Links") @doc(description: "An array containing information about the links for this downloadable product.") + links_purchased_separately: Int @doc(description: "A value of 1 indicates that each link in the array must be purchased separately.") + links_title: String @doc(description: "The heading above the list of downloadable products.") } enum DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") { @@ -42,48 +42,48 @@ enum DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get th URL @deprecated(reason: "`sample_url` serves to get the downloadable sample") } -type DownloadableProductLinks @doc(description: "DownloadableProductLinks defines characteristics of a downloadable product") { - id: Int @deprecated(reason: "This information should not be exposed on frontend") - title: String @doc(description: "The display name of the link") - sort_order: Int @doc(description: "A number indicating the sort order") - price: Float @doc(description: "The price of the downloadable product") - sample_url: String @doc(description: "URL to the downloadable sample") - is_shareable: Boolean @deprecated(reason: "This information should not be exposed on frontend") - number_of_downloads: Int @deprecated(reason: "This information should not be exposed on frontend") +type DownloadableProductLinks @doc(description: "Defines characteristics of a downloadable product.") { + id: Int @deprecated(reason: "This information should not be exposed on frontend.") + title: String @doc(description: "The display name of the link.") + sort_order: Int @doc(description: "A number indicating the sort order.") + price: Float @doc(description: "The price of the downloadable product.") + sample_url: String @doc(description: "The full URL to the downloadable sample.") + is_shareable: Boolean @deprecated(reason: "This information should not be exposed on frontend.") + number_of_downloads: Int @deprecated(reason: "This information should not be exposed on frontend.") link_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") sample_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") sample_file: String @deprecated(reason: "`sample_url` serves to get the downloadable sample") uid: ID! @doc(description: "The unique ID for a `DownloadableProductLinks` object.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\DownloadableLinksValueUid") } -type DownloadableProductSamples @doc(description: "DownloadableProductSamples defines characteristics of a downloadable product") { - id: Int @deprecated(reason: "This information should not be exposed on frontend") - title: String @doc(description: "The display name of the sample") - sort_order: Int @doc(description: "A number indicating the sort order") - sample_url: String @doc(description: "URL to the downloadable sample") +type DownloadableProductSamples @doc(description: "Defines characteristics of a downloadable product.") { + id: Int @deprecated(reason: "This information should not be exposed on frontend.") + title: String @doc(description: "The display name of the sample.") + sort_order: Int @doc(description: "A number indicating the sort order.") + sample_url: String @doc(description: "The full URL to the downloadable sample.") sample_type: DownloadableFileTypeEnum @deprecated(reason: "`sample_url` serves to get the downloadable sample") sample_file: String @deprecated(reason: "`sample_url` serves to get the downloadable sample") } -type DownloadableOrderItem implements OrderItemInterface { - downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are ordered from the downloadable product") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Order\\Item\\Links") +type DownloadableOrderItem implements OrderItemInterface @doc(description: "Defines downloadable product options for `OrderItemInterface`.") { + downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are ordered from the downloadable product.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Order\\Item\\Links") } -type DownloadableInvoiceItem implements InvoiceItemInterface { - downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are invoiced from the downloadable product") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Order\\Item\\Links") +type DownloadableInvoiceItem implements InvoiceItemInterface @doc(description: "Defines downloadable product options for `InvoiceItemInterface`.") { + downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are invoiced from the downloadable product.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Order\\Item\\Links") } -type DownloadableCreditMemoItem implements CreditMemoItemInterface { - downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are refunded from the downloadable product") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Order\\Item\\Links") +type DownloadableCreditMemoItem implements CreditMemoItemInterface @doc(description: "Defines downloadable product options for `CreditMemoItemInterface`.") { + downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are refunded from the downloadable product.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Order\\Item\\Links") } -type DownloadableItemsLinks @doc(description: "DownloadableProductLinks defines characteristics of a downloadable product") { - title: String @doc(description: "The display name of the link") - sort_order: Int @doc(description: "A number indicating the sort order") +type DownloadableItemsLinks @doc(description: "Defines characteristics of the links for downloadable product.") { + title: String @doc(description: "The display name of the link.") + sort_order: Int @doc(description: "A number indicating the sort order.") uid: ID! @doc(description: "The unique ID for a `DownloadableItemsLinks` object.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\DownloadableLinksValueUid") } -type DownloadableWishlistItem implements WishlistItemInterface @doc(description: "A downloadable product wish list item") { - links_v2: [DownloadableProductLinks] @doc(description: "An array containing information about the selected links") @resolver(class: "\\Magento\\DownloadableGraphQl\\Model\\Wishlist\\ItemLinks") - samples: [DownloadableProductSamples] @doc(description: "An array containing information about the selected samples") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Samples") +type DownloadableWishlistItem implements WishlistItemInterface @doc(description: "A downloadable product wish list item.") { + links_v2: [DownloadableProductLinks] @doc(description: "An array containing information about the selected links.") @resolver(class: "\\Magento\\DownloadableGraphQl\\Model\\Wishlist\\ItemLinks") + samples: [DownloadableProductSamples] @doc(description: "An array containing information about the selected samples.") @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Samples") } diff --git a/app/code/Magento/EavGraphQl/etc/schema.graphqls b/app/code/Magento/EavGraphQl/etc/schema.graphqls index c41fde7c7144f..25f53c4ad7ea8 100644 --- a/app/code/Magento/EavGraphQl/etc/schema.graphqls +++ b/app/code/Magento/EavGraphQl/etc/schema.graphqls @@ -2,42 +2,42 @@ # See COPYING.txt for license details. type Query { - customAttributeMetadata(attributes: [AttributeInput!]!): CustomAttributeMetadata @resolver(class: "Magento\\EavGraphQl\\Model\\Resolver\\CustomAttributeMetadata") @doc(description: "The customAttributeMetadata query returns the attribute type, given an attribute code and entity type") @cache(cacheable: false) + customAttributeMetadata(attributes: [AttributeInput!]! @doc(description: "An input object that specifies the attribute code and entity type to search.")): CustomAttributeMetadata @resolver(class: "Magento\\EavGraphQl\\Model\\Resolver\\CustomAttributeMetadata") @doc(description: "Return the attribute type, given an attribute code and entity type.") @cache(cacheable: false) } -type CustomAttributeMetadata @doc(description: "CustomAttributeMetadata defines an array of attribute_codes and entity_types") { - items: [Attribute] @doc(description: "An array of attributes") +type CustomAttributeMetadata @doc(description: "Defines an array of custom attributes.") { + items: [Attribute] @doc(description: "An array of attributes.") } -type Attribute @doc(description: "Attribute contains the attribute_type of the specified attribute_code and entity_type") { +type Attribute @doc(description: "Contains details about the attribute, including the code and type.") { attribute_code: String @doc(description: "The unique identifier for an attribute code. This value should be in lowercase letters without spaces.") - entity_type: String @doc(description: "The type of entity that defines the attribute") - attribute_type: String @doc(description: "The data type of the attribute") - input_type: String @doc(description: "The frontend input type of the attribute") + entity_type: String @doc(description: "The type of entity that defines the attribute.") + attribute_type: String @doc(description: "The data type of the attribute.") + input_type: String @doc(description: "The frontend input type of the attribute.") attribute_options: [AttributeOption] @resolver(class: "Magento\\EavGraphQl\\Model\\Resolver\\AttributeOptions") @doc(description: "Attribute options list.") - storefront_properties: StorefrontProperties @doc(description: "Contains details about the storefront properties configured for the attribute") + storefront_properties: StorefrontProperties @doc(description: "Details about the storefront properties configured for the attribute.") } -type StorefrontProperties { - use_in_product_listing: Boolean @doc(description: "Indicates whether the attribute is displayed in product listings") - position: Int @doc(description: "The relative position of the attribute in the layered navigation block") - visible_on_catalog_pages: Boolean @doc(description: "Indicates whether the attribute is displayed on product pages") - use_in_layered_navigation: UseInLayeredNavigationOptions @doc(description: "Indicates whether the attribute is filterable with results, without results, or not at all") - use_in_search_results_layered_navigation: Boolean @doc(description: "Indicates whether the attribute can be used in layered navigation on search results pages") +type StorefrontProperties @doc(description: "Indicates where an attribute can be displayed.") { + use_in_product_listing: Boolean @doc(description: "Indicates whether the attribute is displayed in product listings.") + position: Int @doc(description: "The relative position of the attribute in the layered navigation block.") + visible_on_catalog_pages: Boolean @doc(description: "Indicates whether the attribute is displayed on product pages.") + use_in_layered_navigation: UseInLayeredNavigationOptions @doc(description: "Indicates whether the attribute is filterable with results, without results, or not at all.") + use_in_search_results_layered_navigation: Boolean @doc(description: "Indicates whether the attribute can be used in layered navigation on search results pages.") } -enum UseInLayeredNavigationOptions { +enum UseInLayeredNavigationOptions @doc(description: "Defines whether the attribute is filterable in layered navigation.") { NO FILTERABLE_WITH_RESULTS FILTERABLE_NO_RESULT } -type AttributeOption @doc(description: "Attribute option.") { - label: String @doc(description: "Attribute option label.") - value: String @doc(description: "Attribute option value.") +type AttributeOption @doc(description: "Defines an attribute option.") { + label: String @doc(description: "The label assigned to the attribute option.") + value: String @doc(description: "The attribute option value.") } -input AttributeInput @doc(description: "AttributeInput specifies the attribute_code and entity_type to search") { +input AttributeInput @doc(description: "Defines the attribute characteristics to search for the `attribute_code` and `entity_type` to search.") { attribute_code: String @doc(description: "The unique identifier for an attribute code. This value should be in lowercase letters without spaces.") - entity_type: String @doc(description: "The type of entity that defines the attribute") + entity_type: String @doc(description: "The type of entity that defines the attribute.") } diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index 65280ad1ad2aa..63e39ce30666f 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -47,36 +47,36 @@ type Query { type Mutation { } -input FilterTypeInput @doc(description: "FilterTypeInput specifies which action will be performed in a query ") { - eq: String @doc(description: "Equals") - finset: [String] @deprecated (reason: "The finset filter is deprecated. Magento doesn't recomend to store comma separated values, therefore finset filter is redundant.") - from: String @doc(description: "From. Must be used with 'to'") - gt: String @doc(description: "Greater than") - gteq: String @doc(description: "Greater than or equal to") - in: [String] @doc(description: "In. The value can contain a set of comma-separated values") - like: String @doc(description: "Like. The specified value can contain % (percent signs) to allow matching of 0 or more characters") - lt: String @doc(description: "Less than") - lteq: String @doc(description: "Less than or equal to") - moreq: String @doc(description: "More than or equal to") - neq: String @doc(description: "Not equal to") - notnull: String @doc(description: "Not null") - null: String @doc(description: "Is null") - to: String@doc(description: "To. Must be used with 'from'") - nin: [String] @doc(description: "Not in. The value can contain a set of comma-separated values") +input FilterTypeInput @doc(description: "Defines the comparison operators that can be used in a filter.") { + eq: String @doc(description: "Equals.") + finset: [String] @deprecated (reason: "We do not recommend storing comma separated values, therefore the `finset` filter is redundant.") + from: String @doc(description: "From. Must be used with the `to` field.") + gt: String @doc(description: "Greater than.") + gteq: String @doc(description: "Greater than or equal to.") + in: [String] @doc(description: "In. The value can contain a set of comma-separated values.") + like: String @doc(description: "Like. The specified value can contain % (percent signs) to allow matching of 0 or more characters.") + lt: String @doc(description: "Less than.") + lteq: String @doc(description: "Less than or equal to.") + moreq: String @doc(description: "More than or equal to.") + neq: String @doc(description: "Not equal to.") + notnull: String @doc(description: "Not null.") + null: String @doc(description: "Is null.") + to: String@doc(description: "To. Must be used with the `from` field.") + nin: [String] @doc(description: "Not in. The value can contain a set of comma-separated values.") } input FilterEqualTypeInput @doc(description: "Defines a filter that matches the input exactly.") { - in: [String] @doc(description: "An array of values to filter on") - eq: String @doc(description: "A string to filter on") + in: [String] @doc(description: "Use this attribute to filter on an array of values. For example, to filter on category IDs 4, 5, and 6, specify a value of `[\"4\", \"5\", \"6\"]`.") + eq: String @doc(description: "Use this attribute to exactly match the specified string. For example, to filter on a specific category ID, specify a value such as `5`.") } input FilterRangeTypeInput @doc(description: "Defines a filter that matches a range of values, such as prices or dates.") { - from: String @doc(description: "The beginning of the range") - to: String @doc(description: "The end of the range") + from: String @doc(description: "Use this attribute to specify the lowest possible value in the range.") + to: String @doc(description: "Use this attribute to specify the highest possible value in the range.") } input FilterMatchTypeInput @doc(description: "Defines a filter that performs a fuzzy search.") { - match: String @doc(description: "One or more words to filter on") + match: String @doc(description: "Use this attribute to exactly match the specified string. For example, to filter on a specific SKU, specify a value such as `24-MB01`.") } input FilterStringTypeInput @doc(description: "Defines a filter for an input string.") { @@ -85,27 +85,27 @@ input FilterStringTypeInput @doc(description: "Defines a filter for an input str match: String @doc(description: "Defines a filter that performs a fuzzy search using the specified string.") } -type SearchResultPageInfo @doc(description: "SearchResultPageInfo provides navigation for the query response") { - page_size: Int @doc(description: "Specifies the maximum number of items to return") - current_page: Int @doc(description: "Specifies which page of results to return") - total_pages: Int @doc(description: "Total pages") +type SearchResultPageInfo @doc(description: "Provides navigation for the query response.") { + page_size: Int @doc(description: "The maximum number of items to return per page of results.") + current_page: Int @doc(description: "The specific page to return.") + total_pages: Int @doc(description: "The total number of pages in the response.") } -enum SortEnum @doc(description: "This enumeration indicates whether to return results in ascending or descending order") { +enum SortEnum @doc(description: "Indicates whether to return results in ascending or descending order.") { ASC DESC } type ComplexTextValue { - html: String! @doc(description: "HTML format") + html: String! @doc(description: "Text that can contain HTML tags.") } -type Money @doc(description: "A Money object defines a monetary value, including a numeric value and a currency code.") { - value: Float @doc(description: "A number expressing a monetary value") - currency: CurrencyEnum @doc(description: "A three-letter currency code, such as USD or EUR") +type Money @doc(description: "Defines a monetary value, including a numeric value and a currency code.") { + value: Float @doc(description: "A number expressing a monetary value.") + currency: CurrencyEnum @doc(description: "A three-letter currency code, such as USD or EUR.") } -enum CurrencyEnum @doc(description: "The list of available currency codes") { +enum CurrencyEnum @doc(description: "The list of available currency codes.") { AFN ALL AZN @@ -278,7 +278,7 @@ enum CurrencyEnum @doc(description: "The list of available currency codes") { XPF } -input EnteredOptionInput @doc(description: "Defines a customer-entered option") { - uid: ID! @doc(description: "The unique ID for a `CustomizableFieldOption`, `CustomizableFileOption`, `CustomizableAreaOption`, etc. of `CustomizableOptionInterface` objects") - value: String! @doc(description: "Text the customer entered") +input EnteredOptionInput @doc(description: "Defines a customer-entered option.") { + uid: ID! @doc(description: "The unique ID for a `CustomizableOptionInterface` object, such as a `CustomizableFieldOption`, `CustomizableFileOption`, or `CustomizableAreaOption` object.") + value: String! @doc(description: "Text the customer entered.") } diff --git a/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls b/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls index c0d309130a3ef..1df309fe105e7 100644 --- a/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls @@ -1,15 +1,15 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type GroupedProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface @doc(description: "A grouped product consists of simple standalone products that are presented as a group") { - items: [GroupedProductItem] @doc(description: "An array containing grouped product items") @resolver(class: "Magento\\GroupedProductGraphQl\\Model\\Resolver\\GroupedItems") +type GroupedProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface @doc(description: "Defines a grouped product, which consists of simple standalone products that are presented as a group.") { + items: [GroupedProductItem] @doc(description: "An array containing grouped product items.") @resolver(class: "Magento\\GroupedProductGraphQl\\Model\\Resolver\\GroupedItems") } -type GroupedProductItem @doc(description: "GroupedProductItem contains information about an individual grouped product item"){ - qty: Float @doc(description: "The quantity of this grouped product item") - position: Int @doc(description: "The relative position of this item compared to the other group items") - product: ProductInterface @doc(description: "The ProductInterface object, which contains details about this product option") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") +type GroupedProductItem @doc(description: "Contains information about an individual grouped product item."){ + qty: Float @doc(description: "The quantity of this grouped product item.") + position: Int @doc(description: "The relative position of this item compared to the other group items.") + product: ProductInterface @doc(description: "Details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") } -type GroupedProductWishlistItem implements WishlistItemInterface @doc(description: "A grouped product wish list item") { +type GroupedProductWishlistItem implements WishlistItemInterface @doc(description: "A grouped product wish list item.") { } diff --git a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls index 296f5b23a8b5f..86bdf35f79447 100755 --- a/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/LoginAsCustomerGraphQl/etc/schema.graphqls @@ -3,30 +3,30 @@ type Mutation { generateCustomerTokenAsAdmin( - input: GenerateCustomerTokenAsAdminInput! + input: GenerateCustomerTokenAsAdminInput! @doc(description: "An input object that defines the customer email address.") ): GenerateCustomerTokenAsAdminOutput @resolver(class: "Magento\\LoginAsCustomerGraphQl\\Model\\Resolver\\RequestCustomerToken") - @doc(description: "Request a customer token so that an administrator can perform remote shopping assistance") + @doc(description: "Request a customer token so that an administrator can perform remote shopping assistance.") } -input GenerateCustomerTokenAsAdminInput { - customer_email: String! @doc(description: "The email address of the customer requesting remote shopping assistance") +input GenerateCustomerTokenAsAdminInput @doc(description: "Identifies which customer requires remote shopping assistance.") { + customer_email: String! @doc(description: "The email address of the customer requesting remote shopping assistance.") } -type GenerateCustomerTokenAsAdminOutput { - customer_token: String! @doc(description: "The generated customer token") +type GenerateCustomerTokenAsAdminOutput @doc(description: "Contains the generated customer token.") { + customer_token: String! @doc(description: "The generated customer token.") } type Customer { allow_remote_shopping_assistance: Boolean! @resolver(class: "Magento\\LoginAsCustomerGraphQl\\Model\\Resolver\\isRemoteShoppingAssistanceAllowed") - @doc(description: "Indicates whether the customer has enabled remote shopping assistance") + @doc(description: "Indicates whether the customer has enabled remote shopping assistance.") } input CustomerCreateInput { - allow_remote_shopping_assistance: Boolean @doc(description: "Indicates whether the customer has enabled remote shopping assistance") + allow_remote_shopping_assistance: Boolean @doc(description: "Indicates whether the customer has enabled remote shopping assistance.") } input CustomerUpdateInput { - allow_remote_shopping_assistance: Boolean @doc(description: "Indicates whether the customer has enabled remote shopping assistance") + allow_remote_shopping_assistance: Boolean @doc(description: "Indicates whether the customer has enabled remote shopping assistance.") } diff --git a/app/code/Magento/NewsletterGraphQl/etc/schema.graphqls b/app/code/Magento/NewsletterGraphQl/etc/schema.graphqls index d96756e12caea..7c2d5ca6b26bc 100644 --- a/app/code/Magento/NewsletterGraphQl/etc/schema.graphqls +++ b/app/code/Magento/NewsletterGraphQl/etc/schema.graphqls @@ -2,14 +2,14 @@ # See COPYING.txt for license details. type Mutation { - subscribeEmailToNewsletter(email: String!): SubscribeEmailToNewsletterOutput @doc(description:"Subscribes the specified email to a newsletter") @resolver(class: "Magento\\NewsletterGraphQl\\Model\\Resolver\\SubscribeEmailToNewsletter") + subscribeEmailToNewsletter(email: String! @doc(description: "The email address that will receive the store's newsletter.")): SubscribeEmailToNewsletterOutput @doc(description:"Subscribe the specified email to the store's newsletter.") @resolver(class: "Magento\\NewsletterGraphQl\\Model\\Resolver\\SubscribeEmailToNewsletter") } -type SubscribeEmailToNewsletterOutput { - status: SubscriptionStatusesEnum @doc(description: "Returns the status of the subscription request") +type SubscribeEmailToNewsletterOutput @doc(description: "Contains the result of the `subscribeEmailToNewsletter` operation.") { + status: SubscriptionStatusesEnum @doc(description: "The status of the subscription request.") } -enum SubscriptionStatusesEnum { +enum SubscriptionStatusesEnum @doc(description: "Indicates the status of the request.") { NOT_ACTIVE SUBSCRIBED UNSUBSCRIBED diff --git a/app/code/Magento/PaymentGraphQl/etc/schema.graphqls b/app/code/Magento/PaymentGraphQl/etc/schema.graphqls index dd5db9d193c64..91150362dc5ef 100644 --- a/app/code/Magento/PaymentGraphQl/etc/schema.graphqls +++ b/app/code/Magento/PaymentGraphQl/etc/schema.graphqls @@ -1,21 +1,21 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. type StoreConfig { - zero_subtotal_enabled: Boolean @doc(description: "Indicates whether the Zero Subtotal payment method is enabled") - zero_subtotal_title: String @doc(description: "The title of the Zero Subtotal payment method displayed on the storefront") - zero_subtotal_new_order_status: String @doc(description: "Status of new orders placed using the Zero Subtotal payment method") - zero_subtotal_payment_action: String @doc(description: "When the new order status is 'Processing', this can be set to 'authorize_capture' to automatically invoice all items that have a zero balance") - zero_subtotal_enable_for_specific_countries: Boolean @doc(description: "Indicates whether only specific countries can use this payment method") - zero_subtotal_payment_from_specific_countries: String @doc(description: "Comma-separated list of specific countries allowed to use the Zero Subtotal payment method") - zero_subtotal_sort_order: Int @doc(description: "A number indicating the position of the Zero Subtotal payment method in the list of available payment methods during checkout") - check_money_order_enabled: Boolean @doc(description: "Indicates whether the Check/Money Order payment method is enabled") - check_money_order_title: String @doc(description: "The title of the Check/Money Order payment method displayed on the storefront") - check_money_order_new_order_status: String @doc(description: "Status of new orders placed using the Check/Money Order payment method") - check_money_order_enable_for_specific_countries: Boolean @doc(description: "Indicates whether only specific countries can use this payment method") - check_money_order_payment_from_specific_countries: String @doc(description: "Comma-separated list of specific countries allowed to use the Check/Money Order payment method") - check_money_order_make_check_payable_to: String @doc(description: "The name of the party to whom the check must be payable") - check_money_order_send_check_to: String @doc(description: "The full street address or PO Box where the checks are mailed") - check_money_order_min_order_total: String @doc(description: "Minimum order amount required to qualify for the Check/Money Order payment method") - check_money_order_max_order_total: String @doc(description: "Maximum order amount required to qualify for the Check/Money Order payment method") - check_money_order_sort_order: Int @doc(description: "A number indicating the position of the Check/Money Order payment method in the list of available payment methods during checkout") + zero_subtotal_enabled: Boolean @doc(description: "Indicates whether the Zero Subtotal payment method is enabled.") + zero_subtotal_title: String @doc(description: "The title of the Zero Subtotal payment method displayed on the storefront.") + zero_subtotal_new_order_status: String @doc(description: "The status of new orders placed using the Zero Subtotal payment method.") + zero_subtotal_payment_action: String @doc(description: "When the new order status is 'Processing', this can be set to `authorize_capture` to automatically invoice all items that have a zero balance.") + zero_subtotal_enable_for_specific_countries: Boolean @doc(description: "Indicates whether only specific countries can use this payment method.") + zero_subtotal_payment_from_specific_countries: String @doc(description: "A comma-separated list of specific countries allowed to use the Zero Subtotal payment method.") + zero_subtotal_sort_order: Int @doc(description: "A number indicating the position of the Zero Subtotal payment method in the list of available payment methods during checkout.") + check_money_order_enabled: Boolean @doc(description: "Indicates whether the Check/Money Order payment method is enabled.") + check_money_order_title: String @doc(description: "The title of the Check/Money Order payment method displayed on the storefront.") + check_money_order_new_order_status: String @doc(description: "The status of new orders placed using the Check/Money Order payment method.") + check_money_order_enable_for_specific_countries: Boolean @doc(description: "Indicates whether only specific countries can use this payment method.") + check_money_order_payment_from_specific_countries: String @doc(description: "A comma-separated list of specific countries allowed to use the Check/Money Order payment method.") + check_money_order_make_check_payable_to: String @doc(description: "The name of the party to whom the check must be payable.") + check_money_order_send_check_to: String @doc(description: "The full street address or PO Box where the checks are mailed.") + check_money_order_min_order_total: String @doc(description: "The minimum order amount required to qualify for the Check/Money Order payment method.") + check_money_order_max_order_total: String @doc(description: "The maximum order amount required to qualify for the Check/Money Order payment method.") + check_money_order_sort_order: Int @doc(description: "A number indicating the position of the Check/Money Order payment method in the list of available payment methods during checkout.") } diff --git a/app/code/Magento/PaypalGraphQl/etc/schema.graphqls b/app/code/Magento/PaypalGraphQl/etc/schema.graphqls index cdc8ee6fda2f3..02d2467746065 100644 --- a/app/code/Magento/PaypalGraphQl/etc/schema.graphqls +++ b/app/code/Magento/PaypalGraphQl/etc/schema.graphqls @@ -2,152 +2,152 @@ # See COPYING.txt for license details. type Query { - getPayflowLinkToken(input: PayflowLinkTokenInput!): PayflowLinkToken @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowLinkToken") @doc(description: "Retrieve payment credentials for transaction. Use this query for Payflow Link and Payments Advanced payment methods.") - getHostedProUrl(input: HostedProUrlInput!): HostedProUrl @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\HostedProUrl") @doc(description: "Retrieve secure PayPal url for Payments Pro Hosted Solution transaction.") + getPayflowLinkToken(input: PayflowLinkTokenInput! @doc(description: "An input object that defines the requirements to receive a payment token.")): PayflowLinkToken @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowLinkToken") @doc(description: "Retrieve payment credentials for a transaction. Use this query for Payflow Link and Payments Advanced payment methods.") + getHostedProUrl(input: HostedProUrlInput! @doc(description: "An input object that specifies the cart ID.")): HostedProUrl @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\HostedProUrl") @doc(description: "Retrieve the secure PayPal URL for a Payments Pro Hosted Solution transaction.") } type Mutation { - createPaypalExpressToken(input: PaypalExpressTokenInput!): PaypalExpressTokenOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PaypalExpressToken") @doc(description:"Initiates an Express Checkout transaction and receives a token. Use this mutation for Express Checkout and Payments Standard payment methods.") - createPayflowProToken(input: PayflowProTokenInput!): CreatePayflowProTokenOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProToken") @doc(description: "Initiates a transaction and receives a token. Use this mutation for Payflow Pro and Payments Pro payment methods") - handlePayflowProResponse(input: PayflowProResponseInput!): PayflowProResponseOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProResponse") @doc(description: "Handles payment response and saves payment in Quote. Use this mutations for Payflow Pro and Payments Pro payment methods.") + createPaypalExpressToken(input: PaypalExpressTokenInput! @doc(description: "An input object that defines the requirements to receive a payment token.")): PaypalExpressTokenOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PaypalExpressToken") @doc(description:"Initiate an Express Checkout transaction and receive a token. Use this mutation for Express Checkout and Payments Standard payment methods.") + createPayflowProToken(input: PayflowProTokenInput! @doc(description: "An input object that defines the requirements to fetch payment token information.")): CreatePayflowProTokenOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProToken") @doc(description: "Initiate a transaction and receive a token. Use this mutation for Payflow Pro and Payments Pro payment methods") + handlePayflowProResponse(input: PayflowProResponseInput! @doc(description: "An input object that includes the payload returned by PayPal and the cart ID.")): PayflowProResponseOutput @resolver(class: "\\Magento\\PaypalGraphQl\\Model\\Resolver\\PayflowProResponse") @doc(description: "Handle a payment response and save the payment in Quote. Use this mutation for Payflow Pro and Payments Pro payment methods.") } input PaypalExpressTokenInput @doc(description: "Defines the attributes required to receive a payment token for Express Checkout and Payments Standard payment methods.") { - cart_id: String! @doc(description:"The unique ID that identifies the customer's cart") - code: String! @doc(description:"Payment method code") - urls: PaypalExpressUrlsInput! @doc(description:"A set of relative URLs that PayPal uses in response to various actions during the authorization process") - use_paypal_credit: Boolean @doc(description: "Indicates whether the buyer clicked the PayPal credit button. The default value is false") - express_button: Boolean @doc(description: "Indicates whether the buyer selected the quick checkout button. The default value is false") + cart_id: String! @doc(description:"The unique ID that identifies the customer's cart.") + code: String! @doc(description:"The payment method code.") + urls: PaypalExpressUrlsInput! @doc(description:"A set of relative URLs that PayPal uses in response to various actions during the authorization process.") + use_paypal_credit: Boolean @doc(description: "Indicates whether the buyer clicked the PayPal credit button. The default value is false.") + express_button: Boolean @doc(description: "Indicates whether the buyer selected the quick checkout button. The default value is false.") } -type PaypalExpressToken @doc(description: "Deprecated: use type `PaypalExpressTokenOutput` instead") { - token: String @deprecated(reason: "Use field `token` of type `PaypalExpressTokenOutput` instead") @doc(description:"The token returned by PayPal") - paypal_urls: PaypalExpressUrlList @deprecated(reason: "Use field `paypal_urls` of type `PaypalExpressTokenOutput` instead") @doc(description:"A set of URLs that allow the buyer to authorize payment and adjust checkout details") +type PaypalExpressToken @doc(description: "Deprecated. Use `PaypalExpressTokenOutput` instead.") { + token: String @deprecated(reason: "Use `PaypalExpressTokenOutput.token` instead.") @doc(description:"The token returned by PayPal.") + paypal_urls: PaypalExpressUrlList @deprecated(reason: "Use `PaypalExpressTokenOutput.paypal_urls` instead.") @doc(description:"A set of URLs that allow the buyer to authorize payment and adjust checkout details.") } type PaypalExpressTokenOutput @doc(description: "Contains the token returned by PayPal and a set of URLs that allow the buyer to authorize payment and adjust checkout details. Applies to Express Checkout and Payments Standard payment methods.") { - token: String @doc(description:"The token returned by PayPal") - paypal_urls: PaypalExpressUrlList @doc(description:"A set of URLs that allow the buyer to authorize payment and adjust checkout details") + token: String @doc(description:"The token returned by PayPal.") + paypal_urls: PaypalExpressUrlList @doc(description:"A set of URLs that allow the buyer to authorize payment and adjust checkout details.") } type PayflowLinkToken @doc(description:"Contains information used to generate PayPal iframe for transaction. Applies to Payflow Link and Payments Advanced payment methods.") { - secure_token: String @doc(description:"Secure token generated by PayPal") - secure_token_id: String @doc(description:"Secure token ID generated by PayPal") - mode: PayflowLinkMode @doc(description:"Mode for Payflow transaction") - paypal_url: String @doc(description:"PayPal URL used for requesting Payflow form") + secure_token: String @doc(description:"The secure token generated by PayPal.") + secure_token_id: String @doc(description:"The secure token ID generated by PayPal.") + mode: PayflowLinkMode @doc(description:"The mode for the Payflow transaction.") + paypal_url: String @doc(description:"The PayPal URL used for requesting a Payflow form.") } -type HostedProUrl @doc(description:"Contains secure URL used for Payments Pro Hosted Solution payment method.") { - secure_form_url: String @doc(description:"Secure Url generated by PayPal") +type HostedProUrl @doc(description:"Contains the secure URL used for the Payments Pro Hosted Solution payment method.") { + secure_form_url: String @doc(description:"The secure URL generated by PayPal.") } -input HostedProUrlInput @doc(description:"The required input to request the secure URL for Payments Pro Hosted Solution payment."){ - cart_id: String! @doc(description:"The unique ID that identifies the customer's cart") +input HostedProUrlInput @doc(description:"Contains the required input to request the secure URL for Payments Pro Hosted Solution payment."){ + cart_id: String! @doc(description:"The unique ID that identifies the shopper's cart.") } input PaymentMethodInput { - paypal_express: PaypalExpressInput @doc(description:"Required input for Express Checkout and Payments Standard payments") - payflow_express: PayflowExpressInput @doc(description:"Required input for Payflow Express Checkout payments") - payflow_link: PayflowLinkInput @doc(description:"Required input for PayPal Payflow Link and Payments Advanced payments") - payflowpro: PayflowProInput @doc(description: "Required input type for PayPal Payflow Pro and Payment Pro payments") - hosted_pro: HostedProInput @doc(description:"Required input for PayPal Hosted pro payments") - payflowpro_cc_vault: VaultTokenInput @doc(description:"Required input type for PayPal Payflow Pro vault payments") + paypal_express: PaypalExpressInput @doc(description:"Required input for Express Checkout and Payments Standard payments.") + payflow_express: PayflowExpressInput @doc(description:"Required input for Payflow Express Checkout payments.") + payflow_link: PayflowLinkInput @doc(description:"Required input for PayPal Payflow Link and Payments Advanced payments.") + payflowpro: PayflowProInput @doc(description: "Required input for PayPal Payflow Pro and Payment Pro payments.") + hosted_pro: HostedProInput @doc(description:"Required input for PayPal Hosted pro payments.") + payflowpro_cc_vault: VaultTokenInput @doc(description:"Required input for PayPal Payflow Pro vault payments.") } -input HostedProInput @doc(description:"A set of relative URLs that PayPal will use in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Payments Pro Hosted Solution payment method.") { - return_url: String! @doc(description:"The relative URL of the final confirmation page that PayPal will redirect to upon payment success. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") - cancel_url: String! @doc(description:"The relative URL of the page that PayPal will redirect to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") +input HostedProInput @doc(description:"Contains a set of relative URLs that PayPal uses in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Payments Pro Hosted Solution payment method.") { + return_url: String! @doc(description:"The relative URL of the final confirmation page that PayPal redirects to upon payment success. For example, if the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") + cancel_url: String! @doc(description:"The relative URL of the page that PayPal redirects to when the buyer cancels the transaction in order to choose a different payment method. For example, if the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") } -input PaypalExpressInput @doc(description:"Required input for Express Checkout and Payments Standard payments") { - payer_id: String! @doc(description:"The unique ID of the PayPal user") - token: String! @doc(description:"The token returned by the createPaypalExpressToken mutation") +input PaypalExpressInput @doc(description:"Contains required input for Express Checkout and Payments Standard payments.") { + payer_id: String! @doc(description:"The unique ID of the PayPal user.") + token: String! @doc(description:"The token returned by the `createPaypalExpressToken` mutation.") } -input PayflowExpressInput @doc(description:"Required input for Payflow Express Checkout payments") { - payer_id: String! @doc(description:"The unique ID of the PayPal user") - token: String! @doc(description:"The token returned by the createPaypalExpressToken mutation") +input PayflowExpressInput @doc(description:"Contains required input for Payflow Express Checkout payments.") { + payer_id: String! @doc(description:"The unique ID of the PayPal user.") + token: String! @doc(description:"The token returned by the createPaypalExpressToken mutation.") } -input PaypalExpressUrlsInput @doc(description:"A set of relative URLs that PayPal will use in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Express Checkout and Payments Standard payment methods.") { - return_url: String! @doc(description:"The relative URL of the final confirmation page that PayPal will redirect to upon payment success. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") - cancel_url: String! @doc(description:"The relative URL of the page that PayPal will redirect to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") - success_url: String @doc(description:"The relative URL of the order confirmation page that PayPal will redirect to when the payment is successful and additional confirmation is not needed. Not applicable to most PayPal solutions. If the full URL to this page is https://www.example.com/paypal/action/success.html, the relative URL is paypal/action/success.html.") - pending_url: String @doc(description:"The relative URL of the page that PayPal will redirect to when the payment has been put on hold for additional review. This condition mostly applies to ACH transactions, and is not applicable to most PayPal solutions. If the full URL to this page is https://www.example.com/paypal/action/success_pending.html, the relative URL is paypal/action/success_pending.html. ") +input PaypalExpressUrlsInput @doc(description:"Contains a set of relative URLs that PayPal uses in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Express Checkout and Payments Standard payment methods.") { + return_url: String! @doc(description:"The relative URL of the final confirmation page that PayPal redirects to upon payment success. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") + cancel_url: String! @doc(description:"The relative URL of the page that PayPal redirects to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") + success_url: String @doc(description:"The relative URL of the order confirmation page that PayPal redirects to when the payment is successful and additional confirmation is not needed. Not applicable to most PayPal solutions. If the full URL to this page is https://www.example.com/paypal/action/success.html, the relative URL is paypal/action/success.html.") + pending_url: String @doc(description:"The relative URL of the page that PayPal redirects to when the payment has been put on hold for additional review. This condition mostly applies to ACH transactions, and is not applicable to most PayPal solutions. If the full URL to this page is https://www.example.com/paypal/action/success_pending.html, the relative URL is paypal/action/success_pending.html.") } -type PaypalExpressUrlList @doc(description:"A set of URLs that allow the buyer to authorize payment and adjust checkout details for Express Checkout and Payments Standard transactions.") { - start: String @doc(description:"The URL to the PayPal login page") - edit: String @doc(description:"The PayPal URL that allows the buyer to edit their checkout details") +type PaypalExpressUrlList @doc(description:"Contains a set of URLs that allow the buyer to authorize payment and adjust checkout details for Express Checkout and Payments Standard transactions.") { + start: String @doc(description:"The URL to the PayPal login page.") + edit: String @doc(description:"The PayPal URL that allows the buyer to edit their checkout details.") } -input PayflowLinkInput @doc(description:"A set of relative URLs that PayPal will use in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Payflow Link and Payments Advanced payment methods.") { - return_url: String! @doc(description:"The relative URL of the order confirmation page that PayPal will redirect to when the payment is successful and additional confirmation is not needed. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") - cancel_url: String! @doc(description:"The relative URL of the page that PayPal will redirect to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") - error_url: String! @doc(description:"The relative URL of the transaction error page that PayPal will redirect to upon payment error. If the full URL to this page is https://www.example.com/paypal/action/error.html, the relative URL is paypal/action/error.html.") +input PayflowLinkInput @doc(description:"A set of relative URLs that PayPal uses in response to various actions during the authorization process. Adobe Commerce prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Payflow Link and Payments Advanced payment methods.") { + return_url: String! @doc(description:"The relative URL of the order confirmation page that PayPal redirects to when the payment is successful and additional confirmation is not needed. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") + cancel_url: String! @doc(description:"The relative URL of the page that PayPal redirects to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") + error_url: String! @doc(description:"The relative URL of the transaction error page that PayPal redirects to upon payment error. If the full URL to this page is https://www.example.com/paypal/action/error.html, the relative URL is paypal/action/error.html.") } -input PayflowLinkTokenInput @doc(description:"Input required to fetch payment token information for Payflow Link and Payments Advanced payment methods.") { - cart_id: String! @doc(description:"The unique ID that identifies the customer's cart") +input PayflowLinkTokenInput @doc(description:"Contains information required to fetch payment token information for the Payflow Link and Payments Advanced payment methods.") { + cart_id: String! @doc(description:"The unique ID that identifies the customer's cart.") } -enum PayflowLinkMode @doc(description:"Mode for payment: TEST or LIVE. Applies to Payflow Link and Payments Advanced payment methods.") { +enum PayflowLinkMode @doc(description:"Indicates the mode for payment. Applies to the Payflow Link and Payments Advanced payment methods.") { TEST LIVE } -input PayflowProTokenInput @doc(description:"Input required to fetch payment token information for Payflow Pro and Payments Pro payment methods."){ - cart_id: String! @doc(description:"The unique ID that identifies the customer's cart") +input PayflowProTokenInput @doc(description:"Contains input required to fetch payment token information for the Payflow Pro and Payments Pro payment methods."){ + cart_id: String! @doc(description:"The unique ID that identifies the shopper's cart.") urls: PayflowProUrlInput! @doc(description:"A set of relative URLs that PayPal uses for callback.") } -input PayflowProInput @doc(description:"Required input for Payflow Pro and Payments Pro payment methods.") { - cc_details: CreditCardDetailsInput! @doc(description: "Required input for credit card related information") - is_active_payment_token_enabler: Boolean @doc(description:"States whether details about the customer's credit/debit card should be tokenized for later usage. Required only if Vault is enabled for PayPal Payflow Pro payment integration.") +input PayflowProInput @doc(description:"Contains input for the Payflow Pro and Payments Pro payment methods.") { + cc_details: CreditCardDetailsInput! @doc(description: "Required input for credit card related information.") + is_active_payment_token_enabler: Boolean @doc(description:"Indicates whether details about the shopper's credit/debit card should be tokenized for later usage. Required only if Vault is enabled for the PayPal Payflow Pro payment integration.") } -input CreditCardDetailsInput @doc(description:"Required fields for Payflow Pro and Payments Pro credit card payments") { - cc_type: String! @doc(description: "Credit card type") - cc_exp_year: Int! @doc(description: "Credit card expiration year") - cc_exp_month: Int! @doc(description: "Credit card expiration month") - cc_last_4: Int! @doc(description: "Last 4 digits of the credit card") +input CreditCardDetailsInput @doc(description:"Required fields for Payflow Pro and Payments Pro credit card payments.") { + cc_type: String! @doc(description: "The credit card type.") + cc_exp_year: Int! @doc(description: "The credit card expiration year.") + cc_exp_month: Int! @doc(description: "The credit card expiration month.") + cc_last_4: Int! @doc(description: "The last 4 digits of the credit card.") } -input PayflowProUrlInput @doc(description:"A set of relative URLs that PayPal will use in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for Payflow Pro and Payment Pro payment methods.") { - return_url: String! @doc(description:"The relative URL of the final confirmation page that PayPal will redirect to upon payment success. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") - cancel_url: String! @doc(description:"The relative URL of the page that PayPal will redirect to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") - error_url: String! @doc(description:"The relative URL of the transaction error page that PayPal will redirect to upon payment error. If the full URL to this page is https://www.example.com/paypal/action/error.html, the relative URL is paypal/action/error.html.") +input PayflowProUrlInput @doc(description:"Contains a set of relative URLs that PayPal uses in response to various actions during the authorization process. Magento prepends the base URL to this value to create a full URL. For example, if the full URL is https://www.example.com/path/to/page.html, the relative URL is path/to/page.html. Use this input for the Payflow Pro and Payment Pro payment methods.") { + return_url: String! @doc(description:"The relative URL of the final confirmation page that PayPal redirects to upon payment success. If the full URL to this page is https://www.example.com/paypal/action/return.html, the relative URL is paypal/action/return.html.") + cancel_url: String! @doc(description:"The relative URL of the page that PayPal redirects to when the buyer cancels the transaction in order to choose a different payment method. If the full URL to this page is https://www.example.com/paypal/action/cancel.html, the relative URL is paypal/action/cancel.html.") + error_url: String! @doc(description:"The relative URL of the transaction error page that PayPal redirects to upon payment error. If the full URL to this page is https://www.example.com/paypal/action/error.html, the relative URL is paypal/action/error.html.") } -type PayflowProToken @deprecated(reason: "Use CreatePayflowProTokenOutput instead.") @doc(description: "Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods.") { - secure_token: String! - secure_token_id: String! - response_message: String! - result: Int! - result_code: Int! +type PayflowProToken @deprecated(reason: "Use `CreatePayflowProTokenOutput` instead.") @doc(description: "Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods.") { + secure_token: String! @doc(description: "A secure token generated by PayPal.") + secure_token_id: String! @doc(description: "A secure token ID generated by PayPal.") + response_message: String! @doc(description: "The RESPMSG returned by PayPal. If the `result` is `0`, then `response_message` is `Approved`.") + result: Int! @doc(description:"A non-zero value if any errors occurred.") + result_code: Int! @doc(description: "The RESULT returned by PayPal. A value of `0` indicates the transaction was approved.") } type CreatePayflowProTokenOutput @doc(description: "Contains the secure information used to authorize transaction. Applies to Payflow Pro and Payments Pro payment methods.") { - secure_token: String! - secure_token_id: String! - response_message: String! - result: Int! - result_code: Int! + secure_token: String! @doc(description: "A secure token generated by PayPal.") + secure_token_id: String! @doc(description: "A secure token ID generated by PayPal.") + response_message: String! @doc(description: "The RESPMSG returned by PayPal. If the `result` is `0`, then `response_message` is `Approved`.") + result: Int! @doc(description: "A non-zero value if any errors occurred.") + result_code: Int! @doc(description: "The RESULT returned by PayPal. A value of `0` indicates the transaction was approved.") } input PayflowProResponseInput @doc(description:"Input required to complete payment. Applies to Payflow Pro and Payments Pro payment methods.") { - cart_id: String! - paypal_payload: String! + cart_id: String! @doc(description: "The unique ID that identifies the shopper's cart.") + paypal_payload: String! @doc(description: "The payload returned from PayPal.") } type PayflowProResponseOutput { - cart: Cart! + cart: Cart! @doc(description: "The cart with the updated selected payment method.") } type StoreConfig { payment_payflowpro_cc_vault_active: String @doc(description: "Payflow Pro vault status.") } -input VaultTokenInput @doc(description:"Required input for payment methods with Vault support.") { - public_hash: String! @doc(description: "The public hash of the payment token") +input VaultTokenInput @doc(description:"Contains required input for payment methods with Vault support.") { + public_hash: String! @doc(description: "The public hash of the payment token.") } diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index 6fbf008b2c5cf..41782b83c20d7 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -3,396 +3,394 @@ type Query { """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" - cart(cart_id: String!): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Returns information about shopping cart") @cache(cacheable: false) - customerCart: Cart! @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CustomerCart") @doc(description:"Returns information about the customer shopping cart") @cache(cacheable: false) + cart(cart_id: String! @doc(description: "The unique ID of the cart to query.")): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Return information about the specified shopping cart.") @cache(cacheable: false) + customerCart: Cart! @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CustomerCart") @doc(description:"Return information about the customer's shopping cart.") @cache(cacheable: false) } type Mutation { - createEmptyCart(input: createEmptyCartInput): String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates an empty shopping cart for a guest or logged in user") - addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") - addVirtualProductsToCart(input: AddVirtualProductsToCartInput): AddVirtualProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") - applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart") - removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart") - updateCartItems(input: UpdateCartItemsInput): UpdateCartItemsOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\UpdateCartItems") - removeItemFromCart(input: RemoveItemFromCartInput): RemoveItemFromCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveItemFromCart") - setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart") - setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart") - setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart") - setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentMethodOnCart") + createEmptyCart(input: createEmptyCartInput @doc(description: "An optional input object that assigns the specified ID to the cart.")): String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Create an empty shopping cart for a guest or logged in user") + addSimpleProductsToCart(input: AddSimpleProductsToCartInput @doc(description: "An input object that defines which simple products to add to the cart.")): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description:"Add one or more simple products to the specified cart. We recommend using `addProductsToCart` instead.") + addVirtualProductsToCart(input: AddVirtualProductsToCartInput @doc(description: "An input object that defines which virtual products to add to the cart.")): AddVirtualProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description:"Add one or more virtual products to the specified cart. We recommend using `addProductsToCart` instead.") + applyCouponToCart(input: ApplyCouponToCartInput @doc(description: "An input object that defines the coupon code to apply to the cart.")): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart") @doc(description:"Apply a pre-defined coupon code to the specified cart.") + removeCouponFromCart(input: RemoveCouponFromCartInput @doc(description: "An input object that defines which coupon code to remove from the cart.")): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart") @doc(description:"Remove a previously-applied coupon from the cart. The cart must contain at least one item in order to remove the coupon.") + updateCartItems(input: UpdateCartItemsInput @doc(description: "An input object that defines products to be updated.")): UpdateCartItemsOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\UpdateCartItems") @doc(description:"Modify items in the cart.") + removeItemFromCart(input: RemoveItemFromCartInput @doc(description: "An input object that defines which products to remove from the cart.")): RemoveItemFromCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveItemFromCart") @doc(description:"Delete the entire quantity of a specified item from the cart. If you remove all items from the cart, the cart continues to exist.") + setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput @doc(description: "An input object that defines one or more shipping addresses to be assigned to the cart.")): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart") @doc(description:"Set one or more shipping addresses on a specific cart.") + setBillingAddressOnCart(input: SetBillingAddressOnCartInput @doc(description: "An input object that defines the billing address to be assigned to the cart.")): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart") @doc(description:"Set the billing address on a specific cart.") + setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput @doc(description: "An input object that applies one or more shipping methods to the cart.")): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart") @doc(description:"Set one or more delivery methods on a cart.") + setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput @doc(description: "An input object that defines which payment method to apply to the cart.")): SetPaymentMethodOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentMethodOnCart") @doc(description:"Apply a payment method to the cart.") + setGuestEmailOnCart(input: SetGuestEmailOnCartInput @doc(description: "An input object that defines a guest email address.")): SetGuestEmailOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetGuestEmailOnCart") @doc(description:"Assign the email address of a guest to the cart.") + setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput @deprecated(reason: "Should use setPaymentMethodOnCart and placeOrder mutations in single request.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentAndPlaceOrder") @doc(description:"Set the cart payment method and convert the cart into an order.") """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" - setGuestEmailOnCart(input: SetGuestEmailOnCartInput): SetGuestEmailOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetGuestEmailOnCart") + assignCustomerToGuestCart(cart_id: String!): Cart! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AssignCustomerToGuestCart") @doc(description:"Assign a logged-in customer to the specified guest shopping cart.") """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" - setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput @deprecated(reason: "Should use setPaymentMethodOnCart and placeOrder mutations in single request.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentAndPlaceOrder") - """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" - assignCustomerToGuestCart(cart_id: String!): Cart! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AssignCustomerToGuestCart") @doc(description:"Assign a logged in customer to the specified guest shopping cart.") - """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" - mergeCarts(source_cart_id: String!, destination_cart_id: String): Cart! @doc(description:"Merges the source cart into the destination cart") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\MergeCarts") - placeOrder(input: PlaceOrderInput): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder") - addProductsToCart(cartId: String!, cartItems: [CartItemInput!]!): AddProductsToCartOutput @doc(description:"Add any type of product to the cart") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddProductsToCart") + mergeCarts(source_cart_id: String! @doc(description: "The guest's cart ID before they login."), destination_cart_id: String @doc(description: "The cart ID after the guest logs in.")): Cart! @doc(description:"Transfer the contents of a guest cart into the cart of a logged-in customer.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\MergeCarts") + placeOrder(input: PlaceOrderInput @doc(description: "An input object that defines the shopper's cart ID.")): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder") @doc(description:"Convert the quote into an order.") + addProductsToCart(cartId: String! @doc(description: "The cart ID of the shopper."), cartItems: [CartItemInput!]! @doc(description: "An array that defines the products to add to the cart.")): AddProductsToCartOutput @doc(description:"Add any type of product to the cart.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddProductsToCart") } -input createEmptyCartInput { - cart_id: String +input createEmptyCartInput @doc(description: "Assigns a specific `cart_id` to the empty cart.") { + cart_id: String @doc(description: "The ID to assign to the cart.") } -input AddSimpleProductsToCartInput { - cart_id: String! - cart_items: [SimpleProductCartItemInput!]! +input AddSimpleProductsToCartInput @doc(description: "Defines the simple and group products to add to the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + cart_items: [SimpleProductCartItemInput!]! @doc(description: "An array of simple and group items to add.") } -input SimpleProductCartItemInput { - data: CartItemInput! - customizable_options:[CustomizableOptionInput!] +input SimpleProductCartItemInput @doc(description: "Defines a single product to add to the cart.") { + data: CartItemInput! @doc(description: "An object containing the `sku`, `quantity`, and other relevant information about the product.") + customizable_options:[CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.") } -input AddVirtualProductsToCartInput { - cart_id: String! - cart_items: [VirtualProductCartItemInput!]! +input AddVirtualProductsToCartInput @doc(description: "Defines the virtual products to add to the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + cart_items: [VirtualProductCartItemInput!]! @doc(description: "An array of virtual products to add.") } -input VirtualProductCartItemInput { - data: CartItemInput! - customizable_options:[CustomizableOptionInput!] +input VirtualProductCartItemInput @doc(description: "Defines a single product to add to the cart.") { + data: CartItemInput! @doc(description: "An object containing the `sku`, `quantity`, and other relevant information about the product.") + customizable_options:[CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.") } -input CartItemInput { - sku: String! - quantity: Float! - parent_sku: String @doc(description: "For child products, the SKU of its parent product") - selected_options: [ID!] @doc(description: "The selected options for the base product, such as color or size with unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, `ConfigurableProductOptionsValues`, etc. objects") - entered_options: [EnteredOptionInput!] @doc(description: "An array of entered options for the base product, such as personalization text") +input CartItemInput @doc(description: "Defines an item to be added to the cart.") { + sku: String! @doc(description: "The SKU of the product.") + quantity: Float! @doc(description: "The amount or number of an item to add.") + parent_sku: String @doc(description: "For a child product, the SKU of its parent product.") + selected_options: [ID!] @doc(description: "The selected options for the base product, such as color or size, using the unique ID for an object such as `CustomizableRadioOption`, `CustomizableDropDownOption`, or `ConfigurableProductOptionsValues`.") + entered_options: [EnteredOptionInput!] @doc(description: "An array of entered options for the base product, such as personalization text.") } -input CustomizableOptionInput { - id: Int @doc(description: "The customizable option id of the product") - value_string: String! @doc(description: "The string value of the option") +input CustomizableOptionInput @doc(description: "Defines a customizable option.") { + id: Int @doc(description: "The customizable option ID of the product.") + value_string: String! @doc(description: "The string value of the option.") } -input ApplyCouponToCartInput { - cart_id: String! - coupon_code: String! +input ApplyCouponToCartInput @doc(description: "Specifies the coupon code to apply to the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + coupon_code: String! @doc(description: "A valid coupon code.") } -input UpdateCartItemsInput { - cart_id: String! - cart_items: [CartItemUpdateInput!]! +input UpdateCartItemsInput @doc(description: "Modifies the specified items in the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + cart_items: [CartItemUpdateInput!]! @doc(description: "An array of items to be updated.") } -input CartItemUpdateInput { +input CartItemUpdateInput @doc(description: "A single item to be updated.") { cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.") - cart_item_uid: ID @doc(description: "The unique ID for a `CartItemInterface` object") - quantity: Float - customizable_options: [CustomizableOptionInput!] + cart_item_uid: ID @doc(description: "The unique ID for a `CartItemInterface` object.") + quantity: Float @doc(description: "The new quantity of the item.") + customizable_options: [CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.") } -input RemoveItemFromCartInput { - cart_id: String! +input RemoveItemFromCartInput @doc(description: "Specifies which items to remove from the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.") - cart_item_uid: ID @doc(description: "Required field. The unique ID for a `CartItemInterface` object") + cart_item_uid: ID @doc(description: "Required field. The unique ID for a `CartItemInterface` object.") } -input SetShippingAddressesOnCartInput { - cart_id: String! - shipping_addresses: [ShippingAddressInput!]! +input SetShippingAddressesOnCartInput @doc(description: "Specifies an array of addresses to use for shipping.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + shipping_addresses: [ShippingAddressInput!]! @doc(description: "An array of shipping addresses.") } -input ShippingAddressInput { - customer_address_id: Int # If provided then will be used address from address book - address: CartAddressInput - customer_notes: String +input ShippingAddressInput @doc(description: "Defines a single shipping address.") { + customer_address_id: Int @doc(description: "An ID from the customer's address book that uniquely identifies the address to be used for shipping.") + address: CartAddressInput @doc(description: "Defines a shipping address.") + customer_notes: String @doc(description: "Text provided by the shopper.") } -input SetBillingAddressOnCartInput { - cart_id: String! - billing_address: BillingAddressInput! +input SetBillingAddressOnCartInput @doc(description: "Sets the billing address.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + billing_address: BillingAddressInput! @doc(description: "The billing address.") } -input BillingAddressInput { - customer_address_id: Int - address: CartAddressInput - use_for_shipping: Boolean @doc(description: "Indicates whether to additionally set the shipping address based on the provided billing address") - same_as_shipping: Boolean @doc(description: "Indicates whether to set the billing address based on the existing shipping address on the cart") +input BillingAddressInput @doc(description: "Defines the billing address.") { + customer_address_id: Int @doc(description: "An ID from the customer's address book that uniquely identifies the address to be used for billing.") + address: CartAddressInput @doc(description: "Defines a billing address.") + use_for_shipping: Boolean @doc(description: "Indicates whether to set the shipping address to be the same as this billing address.") + same_as_shipping: Boolean @doc(description: "Indicates whether to set the billing address to be the same as the existing shipping address on the cart.") } -input CartAddressInput { - firstname: String! - lastname: String! - company: String - street: [String!]! - city: String! - region: String - region_id: Int - postcode: String - country_code: String! - telephone: String - save_in_address_book: Boolean @doc(description: "Determines whether to save the address in the customer's address book. The default value is true") +input CartAddressInput @doc(description: "Defines the billing or shipping address to be applied to the cart.") { + firstname: String! @doc(description: "The first name of the customer or guest.") + lastname: String! @doc(description: "The last name of the customer or guest.") + company: String @doc(description: "The company specified for the billing or shipping address.") + street: [String!]! @doc(description: "An array containing the street for the billing or shipping address.") + city: String! @doc(description: "The city specified for the billing or shipping address.") + region: String @doc(description: "A string that defines the state or province of the billing or shipping address.") + region_id: Int @doc(description: "An integer that defines the state or province of the billing or shipping address.") + postcode: String @doc(description: "The ZIP or postal code of the billing or shipping address.") + country_code: String! @doc(description: "The country code and label for the billing or shipping address.") + telephone: String @doc(description: "The telephone number for the billing or shipping address.") + save_in_address_book: Boolean @doc(description: "Determines whether to save the address in the customer's address book. The default value is true.") } -input SetShippingMethodsOnCartInput { - cart_id: String! - shipping_methods: [ShippingMethodInput!]! +input SetShippingMethodsOnCartInput @doc(description: "Applies one or shipping methods to the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + shipping_methods: [ShippingMethodInput!]! @doc(description: "An array of shipping methods.") } -input ShippingMethodInput { - carrier_code: String! - method_code: String! +input ShippingMethodInput @doc(description: "Defines the shipping carrier and method.") { + carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline delivery method.") + method_code: String! @doc(description: "A string that indicates which service a commercial carrier will use to ship items. For offline delivery methods, this value is similar to the label displayed on the checkout page.") } -input SetPaymentMethodAndPlaceOrderInput { - cart_id: String! - payment_method: PaymentMethodInput! +input SetPaymentMethodAndPlaceOrderInput @doc(description: "Applies a payment method to the quote.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + payment_method: PaymentMethodInput! @doc(description: "The payment method data to apply to the cart.") } -input PlaceOrderInput { - cart_id: String! +input PlaceOrderInput @doc(description: "Specifies the quote to be converted to an order.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") } -input SetPaymentMethodOnCartInput { - cart_id: String! - payment_method: PaymentMethodInput! +input SetPaymentMethodOnCartInput @doc(description: "Applies a payment method to the cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + payment_method: PaymentMethodInput! @doc(description: "The payment method data to apply to the cart.") } -input PaymentMethodInput { - code: String! @doc(description:"Payment method code") - purchase_order_number: String @doc(description:"Purchase order number") +input PaymentMethodInput @doc(description: "Defines the payment method.") { + code: String! @doc(description: "The internal name for the payment method.") + purchase_order_number: String @doc(description:"The purchase order number. Optional for most payment methods.") } -input SetGuestEmailOnCartInput { - cart_id: String! - email: String! +input SetGuestEmailOnCartInput @doc(description: "Defines the guest email and cart.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") + email: String! @doc(description: "The email address of the guest.") } -type CartPrices { - grand_total: Money - subtotal_including_tax: Money - subtotal_excluding_tax: Money - discount: CartDiscount @deprecated(reason: "Use discounts instead ") - subtotal_with_discount_excluding_tax: Money - applied_taxes: [CartTaxItem] - discounts: [Discount] @doc(description:"An array of applied discounts") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Discounts") +type CartPrices @doc(description: "Contains details about the final price of items in the cart, including discount and tax information.") { + grand_total: Money @doc(description: "The total, including discounts, taxes, shipping, and other fees.") + subtotal_including_tax: Money @doc(description: "The subtotal including any applied taxes.") + subtotal_excluding_tax: Money @doc(description: "The subtotal without any applied taxes.") + discount: CartDiscount @deprecated(reason: "Use discounts instead.") + subtotal_with_discount_excluding_tax: Money @doc(description: "The subtotal with any discounts applied, but not taxes.") + applied_taxes: [CartTaxItem] @doc(description: "An array containing the names and amounts of taxes applied to each item in the cart.") + discounts: [Discount] @doc(description:"An array containing all discounts applied to the cart.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Discounts") } -type CartTaxItem { - amount: Money! - label: String! +type CartTaxItem @doc(description: "Contains tax information about an item in the cart.") { + amount: Money! @doc(description: "The amount of tax applied to the item.") + label: String! @doc(description: "The description of the tax.") } -type CartDiscount { - amount: Money! - label: [String!]! +type CartDiscount @doc(description: "Contains information about discounts applied to the cart.") { + amount: Money! @doc(description: "The amount of the discount applied to the item.") + label: [String!]! @doc(description: "The description of the discount.") } -type SetPaymentMethodOnCartOutput { - cart: Cart! +type SetPaymentMethodOnCartOutput @doc(description: "Contains details about the cart after setting the payment method.") { + cart: Cart! @doc(description: "The cart after setting the payment method.") } -type SetBillingAddressOnCartOutput { - cart: Cart! +type SetBillingAddressOnCartOutput @doc(description: "Contains details about the cart after setting the billing address.") { + cart: Cart! @doc(description: "The cart after setting the billing address.") } -type SetShippingAddressesOnCartOutput { - cart: Cart! +type SetShippingAddressesOnCartOutput @doc(description: "Contains details about the cart after setting the shipping addresses.") { + cart: Cart! @doc(description: "The cart after setting the shipping addresses.") } -type SetShippingMethodsOnCartOutput { - cart: Cart! +type SetShippingMethodsOnCartOutput @doc(description: "Contains details about the cart after setting the shipping methods.") { + cart: Cart! @doc(description: "The cart after setting the shipping methods.") } -type ApplyCouponToCartOutput { - cart: Cart! +type ApplyCouponToCartOutput @doc(description: "Contains details about the cart after applying a coupon.") { + cart: Cart! @doc(description: "The cart after applying a coupon.") } -type PlaceOrderOutput { - order: Order! +type PlaceOrderOutput @doc(description: "Contains the results of the request to place an order.") { + order: Order! @doc(description: "The ID of the order.") } -type Cart { - id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The unique ID for a `Cart` object") - items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") - applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead") - applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") - email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") - shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") - billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") - available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods") - selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") - prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices") - total_quantity: Float! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity") - is_virtual: Boolean! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartIsVirtual") +type Cart @doc(description: "Contains the contents and other details about a guest or customer cart.") { + id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The unique ID for a `Cart` object.") + items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") @doc(description: "An array of products that have been added to the cart.") + applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @deprecated(reason: "Use `applied_coupons` instead.") + applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code.") + email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") @doc(description: "The email address of the guest or customer.") + shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") @doc(description: "An array of shipping addresses assigned to the cart.") + billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") @doc(description: "The billing address assigned to the cart.") + available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "An array of available payment methods.") + selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") @doc(description: "Indicates which payment method was applied to the cart.") + prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices") @doc(description: "Pricing details for the quote.") + total_quantity: Float! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity") @doc(description: "The total number of items in the cart.") + is_virtual: Boolean! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartIsVirtual") @doc(description: "Indicates whether the cart contains only virtual products.") } interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") { - firstname: String! - lastname: String! - company: String - street: [String!]! - city: String! - region: CartAddressRegion - postcode: String - country: CartAddressCountry! - telephone: String + firstname: String! @doc(description: "The first name of the customer or guest.") + lastname: String! @doc(description: "The last name of the customer or guest.") + company: String @doc(description: "The company specified for the billing or shipping address.") + street: [String!]! @doc(description: "An array containing the street for the billing or shipping address.") + city: String! @doc(description: "The city specified for the billing or shipping address.") + region: CartAddressRegion @doc(description: "An object containing the region label and code.") + postcode: String @doc(description: "The ZIP or postal code of the billing or shipping address.") + country: CartAddressCountry! @doc(description: "An object containing the country label and code.") + telephone: String @doc(description: "The telephone number for the billing or shipping address.") } -type ShippingCartAddress implements CartAddressInterface { - available_shipping_methods: [AvailableShippingMethod] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\AvailableShippingMethods") - selected_shipping_method: SelectedShippingMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\SelectedShippingMethod") - customer_notes: String - items_weight: Float @deprecated(reason: "This information shoud not be exposed on frontend") - cart_items: [CartItemQuantity] @deprecated(reason: "`cart_items_v2` should be used instead") - cart_items_v2: [CartItemInterface] +type ShippingCartAddress implements CartAddressInterface @doc(description: "Contains shipping addresses and methods.") { + available_shipping_methods: [AvailableShippingMethod] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\AvailableShippingMethods") @doc(description: "An array that lists the shipping methods that can be applied to the cart.") + selected_shipping_method: SelectedShippingMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\SelectedShippingMethod") @doc(description: "An object that describes the selected shipping method.") + customer_notes: String @doc(description: "Text provided by the shopper.") + items_weight: Float @deprecated(reason: "This information should not be exposed on the frontend.") + cart_items: [CartItemQuantity] @deprecated(reason: "Use `cart_items_v2` instead.") + cart_items_v2: [CartItemInterface] @doc(description: "An array that lists the items in the cart.") } -type BillingCartAddress implements CartAddressInterface { - customer_notes: String @deprecated (reason: "The field is used only in shipping address") +type BillingCartAddress implements CartAddressInterface @doc(description: "Contains details about the billing address.") { + customer_notes: String @deprecated (reason: "The field is used only in shipping address.") } -type CartItemQuantity @doc(description:"Deprecated: `cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity`") { - cart_item_id: Int! @deprecated(reason: "`cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity`") - quantity: Float! @deprecated(reason: "`cart_items` field of `ShippingCartAddress` returns now `CartItemInterface` instead of `CartItemQuantity`") +type CartItemQuantity @doc(description: "Deprecated: The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.") { + cart_item_id: Int! @deprecated(reason: "The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.") + quantity: Float! @deprecated(reason: "The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.") } -type CartAddressRegion { - code: String - label: String - region_id: Int +type CartAddressRegion @doc(description: "Contains details about the region in a billing or shipping address.") { + code: String @doc(description: "The state or province code.") + label: String @doc(description: "The display label for the region.") + region_id: Int @doc(description: "The unique ID for a pre-defined region.") } -type CartAddressCountry { - code: String! - label: String! +type CartAddressCountry @doc(description: "Contains details the country in a billing or shipping address.") { + code: String! @doc(description: "The country code.") + label: String! @doc(description: "The display label for the country.") } -type SelectedShippingMethod { - carrier_code: String! - method_code: String! - carrier_title: String! - method_title: String! - amount: Money! - base_amount: Money @deprecated(reason: "The field should not be used on the storefront") +type SelectedShippingMethod @doc(description: "Contains details about the selected shipping method and carrier.") { + carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline shipping method.") + method_code: String! @doc(description: "A shipping method code associated with a carrier.") + carrier_title: String! @doc(description: "The label for the carrier code.") + method_title: String! @doc(description: "The label for the method code.") + amount: Money! @doc(description: "The cost of shipping using this shipping method.") + base_amount: Money @deprecated(reason: "The field should not be used on the storefront.") } -type AvailableShippingMethod { - carrier_code: String! - carrier_title: String! - method_code: String @doc(description: "Could be null if method is not available") - method_title: String @doc(description: "Could be null if method is not available") - error_message: String - amount: Money! - base_amount: Money @deprecated(reason: "The field should not be used on the storefront") - price_excl_tax: Money! - price_incl_tax: Money! - available: Boolean! +type AvailableShippingMethod @doc(description: "Contains details about the possible shipping methods and carriers.") { + carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline shipping method.") + carrier_title: String! @doc(description: "The label for the carrier code.") + method_code: String @doc(description: "A shipping method code associated with a carrier. The value could be null if no method is available.") + method_title: String @doc(description: "The label for the shipping method code. The value could be null if no method is available.") + error_message: String @doc(description: "Describes an error condition.") + amount: Money! @doc(description: "The cost of shipping using this shipping method.") + base_amount: Money @deprecated(reason: "The field should not be used on the storefront.") + price_excl_tax: Money! @doc(description: "The cost of shipping using this shipping method, excluding tax.") + price_incl_tax: Money! @doc(description: "The cost of shipping using this shipping method, including tax.") + available: Boolean! @doc(description: "Indicates whether this shipping method can be applied to the cart.") } -type AvailablePaymentMethod { - code: String! @doc(description: "The payment method code") +type AvailablePaymentMethod @doc(description: "Describes a payment method that the shopper can use to pay for the order.") { + code: String! @doc(description: "The payment method code.") title: String! @doc(description: "The payment method title.") } -type SelectedPaymentMethod { - code: String! @doc(description: "The payment method code") +type SelectedPaymentMethod @doc(description: "Describes the payment method the shopper selected.") { + code: String! @doc(description: "The payment method code.") title: String! @doc(description: "The payment method title.") purchase_order_number: String @doc(description: "The purchase order number.") } -type AppliedCoupon { - code: String! +type AppliedCoupon @doc(description: "Contains the applied coupon code.") { + code: String! @doc(description: "The coupon code the shopper applied to the card.") } -input RemoveCouponFromCartInput { - cart_id: String! +input RemoveCouponFromCartInput @doc(description: "Specifies the cart from which to remove a coupon.") { + cart_id: String! @doc(description: "The unique ID of a `Cart` object.") } -type RemoveCouponFromCartOutput { - cart: Cart +type RemoveCouponFromCartOutput @doc(description: "Contains details about the cart after removing a coupon.") { + cart: Cart @doc(description: "The cart after removing a coupon.") } -type AddSimpleProductsToCartOutput { - cart: Cart! +type AddSimpleProductsToCartOutput @doc(description: "Contains details about the cart after adding simple or group products.") { + cart: Cart! @doc(description: "The cart after adding products.") } -type AddVirtualProductsToCartOutput { - cart: Cart! +type AddVirtualProductsToCartOutput @doc(description: "Contains details about the cart after adding virtual products.") { + cart: Cart! @doc(description: "The cart after adding products.") } -type UpdateCartItemsOutput { - cart: Cart! +type UpdateCartItemsOutput @doc(description: "Contains details about the cart after updating items.") { + cart: Cart! @doc(description: "The cart after updating products.") } -type RemoveItemFromCartOutput { - cart: Cart! +type RemoveItemFromCartOutput @doc(description: "Contains details about the cart after removing an item.") { + cart: Cart! @doc(description: "The cart after removing an item.") } -type SetGuestEmailOnCartOutput { - cart: Cart! +type SetGuestEmailOnCartOutput @doc(description: "Contains details about the cart after setting the email of a guest.") { + cart: Cart! @doc(description: "The cart after setting the guest email.") } -type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") { - customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") +type SimpleCartItem implements CartItemInterface @doc(description: "An implementation for simple product cart items.") { + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing the customizable options the shopper selected.") } -type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Cart Item") { - customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") +type VirtualCartItem implements CartItemInterface @doc(description: "An implementation for virtual product cart items.") { + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing customizable options the shopper selected.") } -interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { - id: String! @deprecated(reason: "Use `uid` instead") - uid: ID! @doc(description: "The unique ID for a `CartItemInterface` object") - quantity: Float! - prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") - product: ProductInterface! +interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") @doc(description: "An interface for products in a cart.") { + id: String! @deprecated(reason: "Use `uid` instead.") + uid: ID! @doc(description: "The unique ID for a `CartItemInterface` object.") + quantity: Float! @doc(description: "The quantity of this item in the cart.") + prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") @doc(description: "Contains details about the price of the item, including taxes and discounts.") + product: ProductInterface! @doc(description: "Details about an item in the cart.") } type Discount @doc(description:"Defines an individual discount. A discount can be applied to the cart as a whole or to an item.") { - amount: Money! @doc(description:"The amount of the discount") - label: String! @doc(description:"A description of the discount") + amount: Money! @doc(description:"The amount of the discount.") + label: String! @doc(description:"A description of the discount.") } -type CartItemPrices { - price: Money! - row_total: Money! - row_total_including_tax: Money! - discounts: [Discount] @doc(description:"An array of discounts to be applied to the cart item") - total_item_discount: Money @doc(description:"The total of all discounts applied to the item") +type CartItemPrices @doc(description: "Contains details about the price of the item, including taxes and discounts.") { + price: Money! @doc(description: "The price of the item before any discounts were applied. The price that might include tax, depending on the configured display settings for cart.") + row_total: Money! @doc(description: "The value of the price multiplied by the quantity of the item.") + row_total_including_tax: Money! @doc(description: "The value of `row_total` plus the tax applied to the item.") + discounts: [Discount] @doc(description: "An array of discounts to be applied to the cart item.") + total_item_discount: Money @doc(description: "The total of all discounts applied to the item.") } -type SelectedCustomizableOption { - id: Int! @deprecated(reason: "Use SelectedCustomizableOption.customizable_option_uid instead") - customizable_option_uid: ID! @doc(description: "The unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, `CustomizableMultipleOption`, etc. of `CustomizableOptionInterface` objects") - label: String! - type: String! - is_required: Boolean! - values: [SelectedCustomizableOptionValue!]! - sort_order: Int! +type SelectedCustomizableOption @doc(description: "Identifies a customized product that has been placed in a cart.") { + id: Int! @deprecated(reason: "Use `SelectedCustomizableOption.customizable_option_uid` instead.") + customizable_option_uid: ID! @doc(description: "The unique ID for a specific `CustomizableOptionInterface` object, such as a `CustomizableFieldOption`, `CustomizableFileOption`, or `CustomizableAreaOption` object.") + label: String! @doc(description: "The display name of the selected customizable option.") + type: String! @doc(description: "The type of `CustomizableOptionInterface` object.") + is_required: Boolean! @doc(description: "Indicates whether the customizable option is required.") + values: [SelectedCustomizableOptionValue!]! @doc(description: "An array of selectable values.") + sort_order: Int! @doc(description: "A value indicating the order to display this option.") } -type SelectedCustomizableOptionValue { - id: Int! @deprecated(reason: "Use SelectedCustomizableOptionValue.customizable_option_value_uid instead") - customizable_option_value_uid: ID! @doc(description: "The unique ID for a `CustomizableMultipleValue`, `CustomizableRadioValue`, `CustomizableCheckboxValue`, `CustomizableDropDownValue`, etc. objects") - label: String! - value: String! - price: CartItemSelectedOptionValuePrice! +type SelectedCustomizableOptionValue @doc(description: "Identifies the value of the selected customized option.") { + id: Int! @deprecated(reason: "Use `SelectedCustomizableOptionValue.customizable_option_value_uid` instead.") + customizable_option_value_uid: ID! @doc(description: "The unique ID for a value object that corresponds to the object represented by the `customizable_option_uid` attribute.") + label: String! @doc(description: "The display name of the selected value.") + value: String! @doc(description: "The text identifying the selected value.") + price: CartItemSelectedOptionValuePrice! @doc(description: "The price of the selected customizable value.") } -type CartItemSelectedOptionValuePrice { - value: Float! - units: String! - type: PriceTypeEnum! +type CartItemSelectedOptionValuePrice @doc(description: "Contains details about the price of a selected customizable value.") { + value: Float! @doc(description: "A price value.") + units: String! @doc(description: "A string that describes the unit of the value.") + type: PriceTypeEnum! @doc(description: "Indicates whether the price type is fixed, percent, or dynamic.") } -type Order { - order_number: String! @doc(description: "The unique ID for a `Order` object.") - order_id: String @deprecated(reason: "The order_id field is deprecated, use order_number instead.") +type Order @doc(description: "Contains the order ID.") { + order_number: String! @doc(description: "The unique ID for an `Order` object.") + order_id: String @deprecated(reason: "Use `order_number` instead.") } type CartUserInputError @doc(description:"An error encountered while adding an item to the the cart.") { - message: String! @doc(description: "A localized error message") - code: CartUserInputErrorType! @doc(description: "Cart-specific error code") + message: String! @doc(description: "A localized error message.") + code: CartUserInputErrorType! @doc(description: "A cart-specific error code.") } -type AddProductsToCartOutput { - cart: Cart! @doc(description: "The cart after products have been added") - user_errors: [CartUserInputError!]! @doc(description: "An error encountered while adding an item to the cart.") +type AddProductsToCartOutput @doc(description: "Contains details about the cart after adding products to it.") { + cart: Cart! @doc(description: "The cart after products have been added.") + user_errors: [CartUserInputError!]! @doc(description: "Contains errors encountered while adding an item to the cart.") } enum CartUserInputErrorType { diff --git a/app/code/Magento/RelatedProductGraphQl/etc/schema.graphqls b/app/code/Magento/RelatedProductGraphQl/etc/schema.graphqls index 849f8fb679806..5af8a58c06daf 100644 --- a/app/code/Magento/RelatedProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/RelatedProductGraphQl/etc/schema.graphqls @@ -2,7 +2,7 @@ # See COPYING.txt for license details. interface ProductInterface { - related_products: [ProductInterface] @doc(description: "Related Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\RelatedProducts") - upsell_products: [ProductInterface] @doc(description: "Upsell Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\UpSellProducts") - crosssell_products: [ProductInterface] @doc(description: "Crosssell Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\CrossSellProducts") + related_products: [ProductInterface] @doc(description: "An array of products to be displayed in a Related Products block.") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\RelatedProducts") + upsell_products: [ProductInterface] @doc(description: "Upsell Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\UpSellProducts") @doc(description: "An array of products to be displayed in an Upsell Products block.") + crosssell_products: [ProductInterface] @doc(description: "Crosssell Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\CrossSellProducts") @doc(description: "An array of products to be displayed in a Cross-sell Products block.") } diff --git a/app/code/Magento/ReviewGraphQl/etc/schema.graphqls b/app/code/Magento/ReviewGraphQl/etc/schema.graphqls index 709e25598a737..de6cf05918106 100644 --- a/app/code/Magento/ReviewGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ReviewGraphQl/etc/schema.graphqls @@ -5,79 +5,79 @@ interface ProductInterface { rating_summary: Float! @doc(description: "The average of all the ratings given to the product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\RatingSummary") review_count: Int! @doc(description: "The total count of all the reviews given to the product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\ReviewCount") reviews( - pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once."), - currentPage: Int = 1 @doc(description: "Specifies which page of results to return."), + pageSize: Int = 20 @doc(description: "The maximum number of results to return at once. The default is 20."), + currentPage: Int = 1 @doc(description: "The page of results to return. The default is 1."), ): ProductReviews! @doc(description: "The list of products reviews.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Reviews") } -type ProductReviews { +type ProductReviews @doc(description: "Contains an array of product reviews.") { items: [ProductReview]! @doc(description: "An array of product reviews.") page_info: SearchResultPageInfo! @doc(description: "Metadata for pagination rendering.") } -type ProductReview @doc(description: "Details of a product review") { - product: ProductInterface! @doc(description: "Contains details about the reviewed product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") - summary: String! @doc(description: "The summary (title) of the review") +type ProductReview @doc(description: "Contains details of a product review.") { + product: ProductInterface! @doc(description: "The reviewed product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product") + summary: String! @doc(description: "The summary (title) of the review.") text: String! @doc(description: "The review text.") - nickname: String! @doc(description: "The customer's nickname. Defaults to the customer name, if logged in") - created_at: String! @doc(description: "Date indicating when the review was created.") - average_rating: Float! @doc(description: "The average rating for product review.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Review\\AverageRating") - ratings_breakdown: [ProductReviewRating!]! @doc(description: "An array of ratings by rating category, such as quality, price, and value") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Review\\RatingBreakdown") + nickname: String! @doc(description: "The customer's nickname. Defaults to the customer name, if logged in.") + created_at: String! @doc(description: "The date the review was created.") + average_rating: Float! @doc(description: "The average of all ratings for this product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Review\\AverageRating") + ratings_breakdown: [ProductReviewRating!]! @doc(description: "An array of ratings by rating category, such as quality, price, and value.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Review\\RatingBreakdown") } -type ProductReviewRating { - name: String! @doc(description: "The label assigned to an aspect of a product that is being rated, such as quality or price") +type ProductReviewRating @doc(description: "Contains data about a single aspect of a product review.") { + name: String! @doc(description: "The label assigned to an aspect of a product that is being rated, such as quality or price.") value: String! @doc(description: "The rating value given by customer. By default, possible values range from 1 to 5.") } type Query { - productReviewRatingsMetadata: ProductReviewRatingsMetadata! @doc(description: "Retrieves metadata required by clients to render the Reviews section.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\ProductReviewRatingsMetadata") + productReviewRatingsMetadata: ProductReviewRatingsMetadata! @doc(description: "Return the active ratings attributes and the values each rating can have.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\ProductReviewRatingsMetadata") } -type ProductReviewRatingsMetadata { - items: [ProductReviewRatingMetadata!]! @doc(description: "List of product reviews sorted by position") +type ProductReviewRatingsMetadata @doc(description: "Contains an array of metadata about each aspect of a product review.") { + items: [ProductReviewRatingMetadata!]! @doc(description: "An array of product reviews sorted by position.") } -type ProductReviewRatingMetadata { +type ProductReviewRatingMetadata @doc(description: "Contains details about a single aspect of a product review.") { id: String! @doc(description: "An encoded rating ID.") - name: String! @doc(description: "The label assigned to an aspect of a product that is being rated, such as quality or price") + name: String! @doc(description: "The label assigned to an aspect of a product that is being rated, such as quality or price.") values: [ProductReviewRatingValueMetadata!]! @doc(description: "List of product review ratings sorted by position.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\ProductReviewRatingValueMetadata") } -type ProductReviewRatingValueMetadata { - value_id: String! @doc(description: "An encoded rating value id.") - value: String! @doc(description: "A ratings scale, such as the number of stars awarded") +type ProductReviewRatingValueMetadata @doc(description: "Contains details about a single value in a product review.") { + value_id: String! @doc(description: "An encoded rating value ID.") + value: String! @doc(description: "A ratings scale, such as the number of stars awarded.") } type Customer { reviews( - pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once."), - currentPage: Int = 1 @doc(description: "Specifies which page of results to return."), - ): ProductReviews! @doc(description: "Contains the customer's product reviews") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Customer\\Reviews") + pageSize: Int = 20 @doc(description: "The maximum number of results to return at once. The default value is 20."), + currentPage: Int = 1 @doc(description: "The page of results to return. The default value is 1."), + ): ProductReviews! @doc(description: "Contains the customer's product reviews.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Customer\\Reviews") } type Mutation { - createProductReview(input: CreateProductReviewInput!): CreateProductReviewOutput! @doc(description: "Creates a product review for the specified SKU") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\CreateProductReview") + createProductReview(input: CreateProductReviewInput! @doc(description: "An input object that contains the details necessary to create a product review.")): CreateProductReviewOutput! @doc(description: "Create a product review for the specified product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\CreateProductReview") } -type CreateProductReviewOutput { - review: ProductReview! @doc(description: "Contains the completed product review") +type CreateProductReviewOutput @doc(description: "Contains the completed product review.") { + review: ProductReview! @doc(description: "Product review details.") } -input CreateProductReviewInput { - sku: String! @doc(description: "The SKU of the reviewed product") - nickname: String! @doc(description: "The customer's nickname. Defaults to the customer name, if logged in") - summary: String! @doc(description: "The summary (title) of the review") +input CreateProductReviewInput @doc(description: "Defines a new product review.") { + sku: String! @doc(description: "The SKU of the reviewed product.") + nickname: String! @doc(description: "The customer's nickname. Defaults to the customer name, if logged in.") + summary: String! @doc(description: "The summary (title) of the review.") text: String! @doc(description: "The review text.") - ratings: [ProductReviewRatingInput!]! @doc(description: "Ratings details by category. e.g price: 5, quality: 4 etc") + ratings: [ProductReviewRatingInput!]! @doc(description: "The ratings details by category. For example, Price: 5 stars, Quality: 4 stars, etc.") } -input ProductReviewRatingInput { +input ProductReviewRatingInput @doc(description: "Contains the reviewer's rating for a single aspect of a review.") { id: String! @doc(description: "An encoded rating ID.") - value_id: String! @doc(description: "An encoded rating value id.") + value_id: String! @doc(description: "An encoded rating value ID.") } -type StoreConfig @doc(description: "The type contains information about a store config") { - product_reviews_enabled : String @doc(description: "Indicates whether product reviews are enabled. Possible values: 1 (Yes) and 0 (No)") - allow_guests_to_write_product_reviews : String @doc(description: "Indicates whether guest users can write product reviews. Possible values: 1 (Yes) and 0 (No)") +type StoreConfig { + product_reviews_enabled : String @doc(description: "Indicates whether product reviews are enabled. Possible values: 1 (Yes) and 0 (No).") + allow_guests_to_write_product_reviews : String @doc(description: "Indicates whether guest users can write product reviews. Possible values: 1 (Yes) and 0 (No).") } diff --git a/app/code/Magento/SalesGraphQl/etc/schema.graphqls b/app/code/Magento/SalesGraphQl/etc/schema.graphqls index 8a76f51d78e79..288f648b50ee9 100644 --- a/app/code/Magento/SalesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SalesGraphQl/etc/schema.graphqls @@ -2,29 +2,29 @@ # See COPYING.txt for license details. type Query { - customerOrders: CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Orders") @deprecated(reason: "Use orders from customer instead") @cache(cacheable: false) + customerOrders: CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Orders") @deprecated(reason: "Use the `customer` query instead.") @cache(cacheable: false) } type Mutation { - reorderItems(orderNumber: String!): ReorderItemsOutput @doc(description:"Adds all products from a customer's previous order to the cart.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Reorder") + reorderItems(orderNumber: String!): ReorderItemsOutput @doc(description:"Add all products from a customer's previous order to the cart.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Reorder") } -type ReorderItemsOutput { - cart: Cart! @doc(description:"Contains detailed information about the customer's cart.") +type ReorderItemsOutput @doc(description:"Contains the cart and any errors after adding products.") { + cart: Cart! @doc(description:"Detailed information about the customer's cart.") userInputErrors:[CheckoutUserInputError]! @doc(description:"An array of reordering errors.") } -type CheckoutUserInputError @doc(description:"An error encountered while adding an item the the cart."){ - message: String! @doc(description: "Localized error message") - path: [String]! @doc(description: "Path to the input field that caused an error. See the GraphQL specification about path errors for details: http://spec.graphql.org/draft/#sec-Errors") - code: CheckoutUserInputErrorCodes! @doc(description: "Checkout-specific error code") +type CheckoutUserInputError @doc(description:"An error encountered while adding an item to the cart."){ + message: String! @doc(description: "A localized error message.") + path: [String]! @doc(description: "The path to the input field that caused an error. See the GraphQL specification about path errors for details: http://spec.graphql.org/draft/#sec-Errors") + code: CheckoutUserInputErrorCodes! @doc(description: "An error code that is specific to Checkout.") } type Customer { orders ( - filter: CustomerOrdersFilterInput @doc(description: "Defines the filter to use for searching customer orders"), - currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1"), - pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. The default value is 20"), + filter: CustomerOrdersFilterInput @doc(description: "Defines the filter to use for searching customer orders."), + currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."), + pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. The default value is 20."), ): CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CustomerOrders") @cache(cacheable: false) } @@ -32,213 +32,213 @@ input CustomerOrdersFilterInput @doc(description: "Identifies the filter to use number: FilterStringTypeInput @doc(description: "Filters by order number.") } -type CustomerOrders @doc(description: "The collection of orders that match the conditions defined in the filter") { - items: [CustomerOrder]! @doc(description: "An array of customer orders") - page_info: SearchResultPageInfo @doc(description: "An object that includes the current_page, page_info, and page_size values specified in the query") - total_count: Int @doc(description: "The total count of customer orders") -} - -type CustomerOrder @doc(description: "Contains details about each of the customer's orders") { - id: ID! @doc(description: "The unique ID for a `CustomerOrder` object") - order_date: String! @doc(description: "The date the order was placed") - status: String! @doc(description: "The current status of the order") - number: String! @doc(description: "The order number") - items: [OrderItemInterface] @doc(description: "An array containing the items purchased in this order") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItems") - total: OrderTotal @doc(description: "Contains details about the calculated totals for this order") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderTotal") - invoices: [Invoice]! @doc(description: "A list of invoices for the order") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoices") - shipments: [OrderShipment] @doc(description: "A list of shipments for the order") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipments") - credit_memos: [CreditMemo] @doc(description: "A list of credit memos") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemos") - payment_methods: [OrderPaymentMethod] @doc(description: "Payment details for the order") - shipping_address: OrderAddress @doc(description: "The shipping address for the order") - billing_address: OrderAddress @doc(description: "The billing address for the order") - carrier: String @doc(description: "The shipping carrier for the order delivery") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CustomerOrders\\Carrier") - shipping_method: String @doc(description: "The delivery method for the order") - comments: [SalesCommentItem] @doc(description: "Comments about the order") - increment_id: String @deprecated(reason: "Use the id attribute instead") - order_number: String! @deprecated(reason: "Use the number attribute instead") - created_at: String @deprecated(reason: "Use the order_date attribute instead") - grand_total: Float @deprecated(reason: "Use the totals.grand_total attribute instead") -} - -type OrderAddress @doc(description: "OrderAddress contains detailed information about an order's billing and shipping addresses"){ - firstname: String! @doc(description: "The first name of the person associated with the shipping/billing address") - lastname: String! @doc(description: "The family name of the person associated with the shipping/billing address") - middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address") - region: String @doc(description: "The state or province name") - region_id: ID @doc(description: "The unique ID for a `Region` object of a pre-defined region") - country_code: CountryCodeEnum @doc(description: "The customer's country") - street: [String!]! @doc(description: "An array of strings that define the street number and name") - company: String @doc(description: "The customer's company") - telephone: String! @doc(description: "The telephone number") - fax: String @doc(description: "The fax number") - postcode: String @doc(description: "The customer's order ZIP or postal code") - city: String! @doc(description: "The city or town") +type CustomerOrders @doc(description: "The collection of orders that match the conditions defined in the filter.") { + items: [CustomerOrder]! @doc(description: "An array of customer orders.") + page_info: SearchResultPageInfo @doc(description: "Contains pagination metadata.") + total_count: Int @doc(description: "The total count of customer orders.") +} + +type CustomerOrder @doc(description: "Contains details about each of the customer's orders.") { + id: ID! @doc(description: "The unique ID for a `CustomerOrder` object.") + order_date: String! @doc(description: "The date the order was placed.") + status: String! @doc(description: "The current status of the order.") + number: String! @doc(description: "The order number.") + items: [OrderItemInterface] @doc(description: "An array containing the items purchased in this order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItems") + total: OrderTotal @doc(description: "Details about the calculated totals for this order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderTotal") + invoices: [Invoice]! @doc(description: "A list of invoices for the order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoices") + shipments: [OrderShipment] @doc(description: "A list of shipments for the order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipments") + credit_memos: [CreditMemo] @doc(description: "A list of credit memos.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemos") + payment_methods: [OrderPaymentMethod] @doc(description: "Payment details for the order.") + shipping_address: OrderAddress @doc(description: "The shipping address for the order.") + billing_address: OrderAddress @doc(description: "The billing address for the order.") + carrier: String @doc(description: "The shipping carrier for the order delivery.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CustomerOrders\\Carrier") + shipping_method: String @doc(description: "The delivery method for the order.") + comments: [SalesCommentItem] @doc(description: "Comments about the order.") + increment_id: String @deprecated(reason: "Use the `id` field instead.") + order_number: String! @deprecated(reason: "Use the `number` field instead.") + created_at: String @deprecated(reason: "Use the `order_date` field instead.") + grand_total: Float @deprecated(reason: "Use the `totals.grand_total` field instead.") +} + +type OrderAddress @doc(description: "Contains detailed information about an order's billing and shipping addresses."){ + firstname: String! @doc(description: "The first name of the person associated with the shipping/billing address.") + lastname: String! @doc(description: "The family name of the person associated with the shipping/billing address.") + middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address.") + region: String @doc(description: "The state or province name.") + region_id: ID @doc(description: "The unique ID for a `Region` object of a pre-defined region.") + country_code: CountryCodeEnum @doc(description: "The customer's country.") + street: [String!]! @doc(description: "An array of strings that define the street number and name.") + company: String @doc(description: "The customer's company.") + telephone: String! @doc(description: "The telephone number.") + fax: String @doc(description: "The fax number.") + postcode: String @doc(description: "The customer's ZIP or postal code.") + city: String! @doc(description: "The city or town.") prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.") - suffix: String @doc(description: "A value such as Sr., Jr., or III") - vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)") + suffix: String @doc(description: "A value such as Sr., Jr., or III.") + vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers).") } -interface OrderItemInterface @doc(description: "Order item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\OrderItem") { - id: ID! @doc(description: "The unique ID for a `OrderItemInterface` object") - product_name: String @doc(description: "The name of the base product") - product_sku: String! @doc(description: "The SKU of the base product") - product_url_key: String @doc(description: "URL key of the base product") +interface OrderItemInterface @doc(description: "Order item details.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\OrderItem") { + id: ID! @doc(description: "The unique ID for an `OrderItemInterface` object.") + product_name: String @doc(description: "The name of the base product.") + product_sku: String! @doc(description: "The SKU of the base product.") + product_url_key: String @doc(description: "URL key of the base product.") product_type: String @doc(description: "The type of product, such as simple, configurable, etc.") - status: String @doc(description: "The status of the order item") - product_sale_price: Money! @doc(description: "The sale price of the base product, including selected options") - discounts: [Discount] @doc(description: "The final discount information for the product") - selected_options: [OrderItemOption] @doc(description: "The selected options for the base product, such as color or size") - entered_options: [OrderItemOption] @doc(description: "The entered option for the base product, such as a logo or image") - quantity_ordered: Float @doc(description: "The number of units ordered for this item") - quantity_shipped: Float @doc(description: "The number of shipped items") - quantity_refunded: Float @doc(description: "The number of refunded items") - quantity_invoiced: Float @doc(description: "The number of invoiced items") - quantity_canceled: Float @doc(description: "The number of canceled items") - quantity_returned: Float @doc(description: "The number of returned items") + status: String @doc(description: "The status of the order item.") + product_sale_price: Money! @doc(description: "The sale price of the base product, including selected options.") + discounts: [Discount] @doc(description: "The final discount information for the product.") + selected_options: [OrderItemOption] @doc(description: "The selected options for the base product, such as color or size.") + entered_options: [OrderItemOption] @doc(description: "The entered option for the base product, such as a logo or image.") + quantity_ordered: Float @doc(description: "The number of units ordered for this item.") + quantity_shipped: Float @doc(description: "The number of shipped items.") + quantity_refunded: Float @doc(description: "The number of refunded items.") + quantity_invoiced: Float @doc(description: "The number of invoiced items.") + quantity_canceled: Float @doc(description: "The number of canceled items.") + quantity_returned: Float @doc(description: "The number of returned items.") } type OrderItem implements OrderItemInterface { } -type OrderItemOption @doc(description: "Represents order item options like selected or entered") { - label: String! @doc(description: "The name of the option") - value: String! @doc(description: "The value of the option") +type OrderItemOption @doc(description: "Represents order item options like selected or entered.") { + label: String! @doc(description: "The name of the option.") + value: String! @doc(description: "The value of the option.") } -type TaxItem @doc(description: "The tax item details") { - amount: Money! @doc(description: "The amount of tax applied to the item") - title: String! @doc(description: "A title that describes the tax") - rate: Float! @doc(description: "The rate used to calculate the tax") +type TaxItem @doc(description: "Contains tax item details.") { + amount: Money! @doc(description: "The amount of tax applied to the item.") + title: String! @doc(description: "A title that describes the tax.") + rate: Float! @doc(description: "The rate used to calculate the tax.") } -type OrderTotal @doc(description: "Contains details about the sales total amounts used to calculate the final price") { - subtotal: Money! @doc(description: "The subtotal of the order, excluding shipping, discounts, and taxes") - discounts: [Discount] @doc(description: "The applied discounts to the order") - total_tax: Money! @doc(description: "The amount of tax applied to the order") - taxes: [TaxItem] @doc(description: "The order tax details") - grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes") - base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency") - total_shipping: Money! @doc(description: "The shipping amount for the order") - shipping_handling: ShippingHandling @doc(description: "Contains details about the shipping and handling costs for the order") +type OrderTotal @doc(description: "Contains details about the sales total amounts used to calculate the final price.") { + subtotal: Money! @doc(description: "The subtotal of the order, excluding shipping, discounts, and taxes.") + discounts: [Discount] @doc(description: "The applied discounts to the order.") + total_tax: Money! @doc(description: "The amount of tax applied to the order.") + taxes: [TaxItem] @doc(description: "The order tax details.") + grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes.") + base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency.") + total_shipping: Money! @doc(description: "The shipping amount for the order.") + shipping_handling: ShippingHandling @doc(description: "Details about the shipping and handling costs for the order.") } -type Invoice @doc(description: "Invoice details") { - id: ID! @doc(description: "The unique ID for a `Invoice` object") - number: String! @doc(description: "Sequential invoice number") - total: InvoiceTotal @doc(description: "Invoice total amount details") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceTotal") - items: [InvoiceItemInterface] @doc(description: "Invoiced product details") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceItems") - comments: [SalesCommentItem] @doc(description: "Comments on the invoice") +type Invoice @doc(description: "Contains invoice details.") { + id: ID! @doc(description: "The unique ID for a `Invoice` object.") + number: String! @doc(description: "Sequential invoice number.") + total: InvoiceTotal @doc(description: "Invoice total amount details.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceTotal") + items: [InvoiceItemInterface] @doc(description: "Invoiced product details.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceItems") + comments: [SalesCommentItem] @doc(description: "Comments on the invoice.") } -interface InvoiceItemInterface @doc(description: "Invoice item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\InvoiceItem") { - id: ID! @doc(description: "The unique ID for a `InvoiceItemInterface` object") - order_item: OrderItemInterface @doc(description: "Contains details about an individual order item") - product_name: String @doc(description: "The name of the base product") - product_sku: String! @doc(description: "The SKU of the base product") - product_sale_price: Money! @doc(description: "The sale price for the base product including selected options") - discounts: [Discount] @doc(description: "Contains information about the final discount amount for the base product, including discounts on options") - quantity_invoiced: Float @doc(description: "The number of invoiced items") +interface InvoiceItemInterface @doc(description: "Contains detailes about invoiced items.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\InvoiceItem") { + id: ID! @doc(description: "The unique ID for an `InvoiceItemInterface` object.") + order_item: OrderItemInterface @doc(description: "Details about an individual order item.") + product_name: String @doc(description: "The name of the base product.") + product_sku: String! @doc(description: "The SKU of the base product.") + product_sale_price: Money! @doc(description: "The sale price for the base product including selected options.") + discounts: [Discount] @doc(description: "Information about the final discount amount for the base product, including discounts on options.") + quantity_invoiced: Float @doc(description: "The number of invoiced items.") } type InvoiceItem implements InvoiceItemInterface { } -type InvoiceTotal @doc(description: "Contains price details from an invoice"){ - subtotal: Money! @doc(description: "The subtotal of the invoice, excluding shipping, discounts, and taxes") - discounts: [Discount] @doc(description: "The applied discounts to the invoice") - total_tax: Money! @doc(description: "The amount of tax applied to the invoice") - taxes: [TaxItem] @doc(description: "The invoice tax details") - grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes") - base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency") - total_shipping: Money! @doc(description: "The shipping amount for the invoice") - shipping_handling: ShippingHandling @doc(description: "Contains details about the shipping and handling costs for the invoice") +type InvoiceTotal @doc(description: "Contains price details from an invoice."){ + subtotal: Money! @doc(description: "The subtotal of the invoice, excluding shipping, discounts, and taxes.") + discounts: [Discount] @doc(description: "The applied discounts to the invoice.") + total_tax: Money! @doc(description: "The amount of tax applied to the invoice.") + taxes: [TaxItem] @doc(description: "The invoice tax details.") + grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes.") + base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency.") + total_shipping: Money! @doc(description: "The shipping amount for the invoice.") + shipping_handling: ShippingHandling @doc(description: "Details about the shipping and handling costs for the invoice.") } -type ShippingHandling @doc(description: "The Shipping handling details") { - total_amount: Money! @doc(description: "The total amount for shipping") - amount_including_tax: Money @doc(description: "The shipping amount, including tax") - amount_excluding_tax: Money @doc(description: "The shipping amount, excluding tax") - taxes: [TaxItem] @doc(description: "Contains details about taxes applied for shipping") - discounts: [ShippingDiscount] @doc(description: "The applied discounts to the shipping") +type ShippingHandling @doc(description: "Contains details about shipping and handling costs.") { + total_amount: Money! @doc(description: "The total amount for shipping.") + amount_including_tax: Money @doc(description: "The shipping amount, including tax.") + amount_excluding_tax: Money @doc(description: "The shipping amount, excluding tax.") + taxes: [TaxItem] @doc(description: "Details about taxes applied for shipping.") + discounts: [ShippingDiscount] @doc(description: "The applied discounts to the shipping.") } type ShippingDiscount @doc(description:"Defines an individual shipping discount. This discount can be applied to shipping.") { - amount: Money! @doc(description:"The amount of the discount") + amount: Money! @doc(description:"The amount of the discount.") } -type OrderShipment @doc(description: "Order shipment details") { - id: ID! @doc(description: "The unique ID for a `OrderShipment` object") - number: String! @doc(description: "The sequential credit shipment number") - tracking: [ShipmentTracking] @doc(description: "Contains shipment tracking details") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentTracking") - items: [ShipmentItemInterface] @doc(description: "Contains items included in the shipment") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentItems") - comments: [SalesCommentItem] @doc(description: "Comments added to the shipment") +type OrderShipment @doc(description: "Contains order shipment details.") { + id: ID! @doc(description: "The unique ID for a `OrderShipment` object.") + number: String! @doc(description: "The sequential credit shipment number.") + tracking: [ShipmentTracking] @doc(description: "An array of shipment tracking details.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentTracking") + items: [ShipmentItemInterface] @doc(description: "An array of items included in the shipment.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentItems") + comments: [SalesCommentItem] @doc(description: "Comments added to the shipment.") } -type SalesCommentItem @doc(description: "Comment item details") { - timestamp: String! @doc(description: "The timestamp of the comment") - message: String! @doc(description: "The text of the message") +type SalesCommentItem @doc(description: "Contains details about a comment.") { + timestamp: String! @doc(description: "The timestamp of the comment.") + message: String! @doc(description: "The text of the message.") } -interface ShipmentItemInterface @doc(description: "Order shipment item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\ShipmentItem"){ - id: ID! @doc(description: "The unique ID for a `ShipmentItemInterface` object") - order_item: OrderItemInterface @doc(description: "Associated order item") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem") - product_name: String @doc(description: "Name of the base product") - product_sku: String! @doc(description: "SKU of the base product") - product_sale_price: Money! @doc(description: "Sale price for the base product") - quantity_shipped: Float! @doc(description: "Number of shipped items") +interface ShipmentItemInterface @doc(description: "Order shipment item details.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\ShipmentItem"){ + id: ID! @doc(description: "The unique ID for a `ShipmentItemInterface` object.") + order_item: OrderItemInterface @doc(description: "The order item associated with the shipment item.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem") + product_name: String @doc(description: "The name of the base product.") + product_sku: String! @doc(description: "The SKU of the base product.") + product_sale_price: Money! @doc(description: "The sale price for the base product.") + quantity_shipped: Float! @doc(description: "The number of shipped items.") } type ShipmentItem implements ShipmentItemInterface { } -type ShipmentTracking @doc(description: "Order shipment tracking details") { - title: String! @doc(description: "The shipment tracking title") - carrier: String! @doc(description: "The shipping carrier for the order delivery") - number: String @doc(description: "The tracking number of the order shipment") +type ShipmentTracking @doc(description: "Contains order shipment tracking details.") { + title: String! @doc(description: "The shipment tracking title.") + carrier: String! @doc(description: "The shipping carrier for the order delivery.") + number: String @doc(description: "The tracking number of the order shipment.") } -type OrderPaymentMethod @doc(description: "Contains details about the payment method used to pay for the order") { - name: String! @doc(description: "The label that describes the payment method") - type: String! @doc(description: "The payment method code that indicates how the order was paid for") - additional_data: [KeyValue] @doc(description: "Additional data per payment method type") +type OrderPaymentMethod @doc(description: "Contains details about the payment method used to pay for the order.") { + name: String! @doc(description: "The label that describes the payment method.") + type: String! @doc(description: "The payment method code that indicates how the order was paid for.") + additional_data: [KeyValue] @doc(description: "Additional data per payment method type.") } -type CreditMemo @doc(description: "Credit memo details") { - id: ID! @doc(description: "The unique ID for a `CreditMemo` object") - number: String! @doc(description: "The sequential credit memo number") - items: [CreditMemoItemInterface] @doc(description: "An array containing details about refunded items") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoItems") - total: CreditMemoTotal @doc(description: "Contains details about the total refunded amount") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoTotal") - comments: [SalesCommentItem] @doc(description: "Comments on the credit memo") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoComments") +type CreditMemo @doc(description: "Contains credit memo details.") { + id: ID! @doc(description: "The unique ID for a `CreditMemo` object.") + number: String! @doc(description: "The sequential credit memo number.") + items: [CreditMemoItemInterface] @doc(description: "An array containing details about refunded items.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoItems") + total: CreditMemoTotal @doc(description: "Details about the total refunded amount.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoTotal") + comments: [SalesCommentItem] @doc(description: "Comments on the credit memo.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoComments") } -interface CreditMemoItemInterface @doc(description: "Credit memo item details") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\CreditMemoItem") { - id: ID! @doc(description: "The unique ID for a `CreditMemoItemInterface` object") - order_item: OrderItemInterface @doc(description: "The order item the credit memo is applied to") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem") - product_name: String @doc(description: "The name of the base product") - product_sku: String! @doc(description: "SKU of the base product") - product_sale_price: Money! @doc(description: "The sale price for the base product, including selected options") - discounts: [Discount] @doc(description: "Contains information about the final discount amount for the base product, including discounts on options") - quantity_refunded: Float @doc(description: "The number of refunded items") +interface CreditMemoItemInterface @doc(description: "Credit memo item details.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\CreditMemoItem") { + id: ID! @doc(description: "The unique ID for a `CreditMemoItemInterface` object.") + order_item: OrderItemInterface @doc(description: "The order item the credit memo is applied to.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem") + product_name: String @doc(description: "The name of the base product.") + product_sku: String! @doc(description: "The SKU of the base product.") + product_sale_price: Money! @doc(description: "The sale price for the base product, including selected options.") + discounts: [Discount] @doc(description: "Details about the final discount amount for the base product, including discounts on options.") + quantity_refunded: Float @doc(description: "The number of refunded items.") } type CreditMemoItem implements CreditMemoItemInterface { } -type CreditMemoTotal @doc(description: "Credit memo price details") { - subtotal: Money! @doc(description: "The subtotal of the invoice, excluding shipping, discounts, and taxes") - discounts: [Discount] @doc(description: "The applied discounts to the credit memo") - total_tax: Money! @doc(description: "The amount of tax applied to the credit memo") - taxes: [TaxItem] @doc(description: "The credit memo tax details") - grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes") - base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency") - total_shipping: Money! @doc(description: "The shipping amount for the credit memo") - shipping_handling: ShippingHandling @doc(description: "Contains details about the shipping and handling costs for the credit memo") - adjustment: Money! @doc(description: "An adjustment manually applied to the order") +type CreditMemoTotal @doc(description: "Contains credit memo price details.") { + subtotal: Money! @doc(description: "The subtotal of the invoice, excluding shipping, discounts, and taxes.") + discounts: [Discount] @doc(description: "The applied discounts to the credit memo.") + total_tax: Money! @doc(description: "The amount of tax applied to the credit memo.") + taxes: [TaxItem] @doc(description: "The credit memo tax details.") + grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes.") + base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency.") + total_shipping: Money! @doc(description: "The shipping amount for the credit memo.") + shipping_handling: ShippingHandling @doc(description: "Details about the shipping and handling costs for the credit memo.") + adjustment: Money! @doc(description: "An adjustment manually applied to the order.") } -type KeyValue @doc(description: "The key-value type") { - name: String @doc(description: "The name part of the name/value pair") - value: String @doc(description: "The value part of the name/value pair") +type KeyValue @doc(description: "Contains a key-value pair.") { + name: String @doc(description: "The name part of the key/value pair.") + value: String @doc(description: "The value part of the key/value pair.") } enum CheckoutUserInputErrorCodes { diff --git a/app/code/Magento/SalesRule/Helper/CartFixedDiscount.php b/app/code/Magento/SalesRule/Helper/CartFixedDiscount.php index b1fda3e78672b..025f2c7215964 100644 --- a/app/code/Magento/SalesRule/Helper/CartFixedDiscount.php +++ b/app/code/Magento/SalesRule/Helper/CartFixedDiscount.php @@ -89,6 +89,31 @@ public function getDiscountAmount( ); } + /** + * Get discount amount for item calculated proportionally based on already applied discount + * + * @param float $ruleDiscount + * @param float $qty + * @param float $baseItemPrice + * @param float $baseItemDiscountAmount + * @param float $baseRuleTotalsDiscount + * @param string $discountType + * @return float + */ + public function getDiscountedAmountProportionally( + float $ruleDiscount, + float $qty, + float $baseItemPrice, + float $baseItemDiscountAmount, + float $baseRuleTotalsDiscount, + string $discountType + ): float { + $baseItemPriceTotal = $baseItemPrice * $qty - $baseItemDiscountAmount; + $ratio = $baseItemPriceTotal / $baseRuleTotalsDiscount; + $discountAmount = $this->deltaPriceRound->round($ruleDiscount * $ratio, $discountType); + return $discountAmount; + } + /** * Get shipping discount amount * @@ -186,10 +211,6 @@ public function getBaseRuleTotals( $baseRuleTotals = ($quote->getIsMultiShipping() && $isMultiShipping) ? $this->getQuoteTotalsForMultiShipping($quote) : $this->getQuoteTotalsForRegularShipping($address, $baseRuleTotals); - } else { - if ($quote->getIsMultiShipping() && $isMultiShipping) { - $baseRuleTotals = $quote->getBaseSubtotal(); - } } return (float) $baseRuleTotals; } diff --git a/app/code/Magento/SalesRule/Model/Quote/Discount.php b/app/code/Magento/SalesRule/Model/Quote/Discount.php index a32fe249920b1..0663e57a0a0f8 100644 --- a/app/code/Magento/SalesRule/Model/Quote/Discount.php +++ b/app/code/Magento/SalesRule/Model/Quote/Discount.php @@ -11,6 +11,7 @@ use Magento\Quote\Api\Data\AddressInterface; use Magento\Quote\Api\Data\ShippingAssignmentInterface; use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; use Magento\Quote\Model\Quote\Address\Total; use Magento\Quote\Model\Quote\Address\Total\AbstractTotal; use Magento\Quote\Model\Quote\Item; @@ -20,8 +21,10 @@ use Magento\SalesRule\Api\Data\RuleDiscountInterfaceFactory; use Magento\SalesRule\Model\Data\RuleDiscount; use Magento\SalesRule\Model\Discount\PostProcessorFactory; +use Magento\SalesRule\Model\Rule; use Magento\SalesRule\Model\Validator; use Magento\Store\Model\StoreManagerInterface; +use Magento\SalesRule\Model\RulesApplier; /** * Discount totals calculation model. @@ -66,6 +69,16 @@ class Discount extends AbstractTotal */ private $discountDataInterfaceFactory; + /** + * @var RulesApplier|null + */ + private $rulesApplier; + + /** + * @var array + */ + private $addressDiscountAggregator = []; + /** * @param ManagerInterface $eventManager * @param StoreManagerInterface $storeManager @@ -73,6 +86,7 @@ class Discount extends AbstractTotal * @param PriceCurrencyInterface $priceCurrency * @param RuleDiscountInterfaceFactory|null $discountInterfaceFactory * @param DiscountDataInterfaceFactory|null $discountDataInterfaceFactory + * @param RulesApplier|null $rulesApplier */ public function __construct( ManagerInterface $eventManager, @@ -80,7 +94,8 @@ public function __construct( Validator $validator, PriceCurrencyInterface $priceCurrency, RuleDiscountInterfaceFactory $discountInterfaceFactory = null, - DiscountDataInterfaceFactory $discountDataInterfaceFactory = null + DiscountDataInterfaceFactory $discountDataInterfaceFactory = null, + RulesApplier $rulesApplier = null ) { $this->setCode(self::COLLECTOR_TYPE_CODE); $this->eventManager = $eventManager; @@ -91,6 +106,8 @@ public function __construct( ?: ObjectManager::getInstance()->get(RuleDiscountInterfaceFactory::class); $this->discountDataInterfaceFactory = $discountDataInterfaceFactory ?: ObjectManager::getInstance()->get(DiscountDataInterfaceFactory::class); + $this->rulesApplier = $rulesApplier + ?: ObjectManager::getInstance()->get(RulesApplier::class); } /** @@ -102,6 +119,7 @@ public function __construct( * @return $this * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function collect( Quote $quote, @@ -109,81 +127,98 @@ public function collect( Total $total ) { parent::collect($quote, $shippingAssignment, $total); - $store = $this->storeManager->getStore($quote->getStoreId()); + /** @var Address $address */ $address = $shippingAssignment->getShipping()->getAddress(); - if ($quote->currentPaymentWasSet()) { $address->setPaymentMethod($quote->getPayment()->getMethod()); } - $this->calculator->reset($address); - - $items = $shippingAssignment->getItems(); - if (!count($items)) { + $itemsAggregate = []; + foreach ($shippingAssignment->getItems() as $item) { + $itemId = $item->getId(); + $itemsAggregate[$itemId] = $item; + } + $items = []; + foreach ($quote->getAllAddresses() as $quoteAddress) { + foreach ($quoteAddress->getAllItems() as $item) { + $items[] = $item; + } + } + if (!$items || !$itemsAggregate) { return $this; } - $eventArgs = [ 'website_id' => $store->getWebsiteId(), 'customer_group_id' => $quote->getCustomerGroupId(), 'coupon_code' => $quote->getCouponCode(), ]; - - $this->calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode()); - $this->calculator->initTotals($items, $address); - $address->setDiscountDescription([]); - $items = $this->calculator->sortItemsByPriority($items, $address); $address->getExtensionAttributes()->setDiscounts([]); - $addressDiscountAggregator = []; - - /** @var Item $item */ + $this->addressDiscountAggregator = []; + $address->setCartFixedRules([]); + $quote->setCartFixedRules([]); foreach ($items as $item) { - if ($item->getNoDiscount() || !$this->calculator->canApplyDiscount($item)) { - $item->setDiscountAmount(0); - $item->setBaseDiscountAmount(0); - - // ensure my children are zeroed out - if ($item->getHasChildren() && $item->isChildrenCalculated()) { - foreach ($item->getChildren() as $child) { - $child->setDiscountAmount(0); - $child->setBaseDiscountAmount(0); - } + $this->rulesApplier->setAppliedRuleIds($item, []); + if ($item->getExtensionAttributes()) { + $item->getExtensionAttributes()->setDiscounts(null); + } + $item->setDiscountAmount(0); + $item->setBaseDiscountAmount(0); + $item->setDiscountPercent(0); + if ($item->getChildren() && $item->isChildrenCalculated()) { + foreach ($item->getChildren() as $child) { + $child->setDiscountAmount(0); + $child->setBaseDiscountAmount(0); + $child->setDiscountPercent(0); + } + } + } + $this->calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode()); + $this->calculator->initTotals($items, $address); + $items = $this->calculator->sortItemsByPriority($items, $address); + $rules = $this->calculator->getRules($address); + /** @var Rule $rule */ + foreach ($rules as $rule) { + /** @var Item $item */ + foreach ($items as $item) { + if ($item->getNoDiscount() || !$this->calculator->canApplyDiscount($item) || $item->getParentItem()) { + continue; } + $eventArgs['item'] = $item; + $this->eventManager->dispatch('sales_quote_address_discount_item', $eventArgs); + $this->calculator->process($item, $rule); + } + $appliedRuleIds = $quote->getAppliedRuleIds() ? explode(',', $quote->getAppliedRuleIds()) : []; + if ($rule->getStopRulesProcessing() && in_array($rule->getId(), $appliedRuleIds)) { + break; + } + $this->calculator->initTotals($items, $address); + } + foreach ($items as $item) { + if (!isset($itemsAggregate[$item->getId()])) { continue; } - // to determine the child item discount, we calculate the parent if ($item->getParentItem()) { continue; - } - - $eventArgs['item'] = $item; - $this->eventManager->dispatch('sales_quote_address_discount_item', $eventArgs); - - if ($item->getHasChildren() && $item->isChildrenCalculated()) { - $this->calculator->process($item); + } elseif ($item->getHasChildren() && $item->isChildrenCalculated()) { foreach ($item->getChildren() as $child) { $eventArgs['item'] = $child; $this->eventManager->dispatch('sales_quote_address_discount_item', $eventArgs); $this->aggregateItemDiscount($child, $total); } - } else { - $this->calculator->process($item); - $this->aggregateItemDiscount($item, $total); } + $this->aggregateItemDiscount($item, $total); if ($item->getExtensionAttributes()) { - $this->aggregateDiscountPerRule($item, $address, $addressDiscountAggregator); + $this->aggregateDiscountPerRule($item, $address); } } - $this->calculator->prepareDescription($address); $total->setDiscountDescription($address->getDiscountDescription()); $total->setSubtotalWithDiscount($total->getSubtotal() + $total->getDiscountAmount()); $total->setBaseSubtotalWithDiscount($total->getBaseSubtotal() + $total->getBaseDiscountAmount()); $address->setDiscountAmount($total->getDiscountAmount()); $address->setBaseDiscountAmount($total->getBaseDiscountAmount()); - return $this; } @@ -273,13 +308,11 @@ public function fetch(Quote $quote, Total $total) * * @param AbstractItem $item * @param AddressInterface $address - * @param array $addressDiscountAggregator * @return void */ private function aggregateDiscountPerRule( AbstractItem $item, - AddressInterface $address, - array &$addressDiscountAggregator + AddressInterface $address ) { $discountBreakdown = $item->getExtensionAttributes()->getDiscounts(); if ($discountBreakdown) { @@ -288,15 +321,17 @@ private function aggregateDiscountPerRule( $discount = $value->getDiscountData(); $ruleLabel = $value->getRuleLabel(); $ruleID = $value->getRuleID(); - if (isset($addressDiscountAggregator[$ruleID])) { + if (isset($this->addressDiscountAggregator[$ruleID])) { /** @var RuleDiscount $cartDiscount */ - $cartDiscount = $addressDiscountAggregator[$ruleID]; + $cartDiscount = $this->addressDiscountAggregator[$ruleID]; $discountData = $cartDiscount->getDiscountData(); - $discountData->setBaseAmount($discountData->getBaseAmount()+$discount->getBaseAmount()); - $discountData->setAmount($discountData->getAmount()+$discount->getAmount()); - $discountData->setOriginalAmount($discountData->getOriginalAmount()+$discount->getOriginalAmount()); + $discountData->setBaseAmount($discountData->getBaseAmount() + $discount->getBaseAmount()); + $discountData->setAmount($discountData->getAmount() + $discount->getAmount()); + $discountData->setOriginalAmount( + $discountData->getOriginalAmount() + $discount->getOriginalAmount() + ); $discountData->setBaseOriginalAmount( - $discountData->getBaseOriginalAmount()+$discount->getBaseOriginalAmount() + $discountData->getBaseOriginalAmount() + $discount->getBaseOriginalAmount() ); } else { $data = [ @@ -313,10 +348,10 @@ private function aggregateDiscountPerRule( ]; /** @var RuleDiscount $cartDiscount */ $cartDiscount = $this->discountInterfaceFactory->create(['data' => $data]); - $addressDiscountAggregator[$ruleID] = $cartDiscount; + $this->addressDiscountAggregator[$ruleID] = $cartDiscount; } } } - $address->getExtensionAttributes()->setDiscounts(array_values($addressDiscountAggregator)); + $address->getExtensionAttributes()->setDiscounts(array_values($this->addressDiscountAggregator)); } } diff --git a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php index 0adeedc32f759..9794dc1628dae 100644 --- a/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php +++ b/app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php @@ -79,11 +79,13 @@ public function calculate($rule, $item, $qty) $ruleTotals = $this->validator->getRuleItemTotalsInfo($rule->getId()); $baseRuleTotals = $ruleTotals['base_items_price'] ?? 0.0; + $baseRuleTotalsDiscount = $ruleTotals['base_items_discount_amount'] ?? 0.0; + $ruleItemsCount = $ruleTotals['items_count'] ?? 0; $address = $item->getAddress(); + $quote = $item->getQuote(); $shippingMethod = $address->getShippingMethod(); $isAppliedToShipping = (int) $rule->getApplyToShipping(); - $quote = $item->getQuote(); $ruleDiscount = (float) $rule->getDiscountAmount(); $isMultiShipping = $this->cartFixedDiscountHelper->checkMultiShippingQuote($quote); @@ -91,6 +93,7 @@ public function calculate($rule, $item, $qty) $baseItemPrice = $this->validator->getItemBasePrice($item); $itemOriginalPrice = $this->validator->getItemOriginalPrice($item); $baseItemOriginalPrice = $this->validator->getItemBaseOriginalPrice($item); + $baseItemDiscountAmount = (float) $item->getBaseDiscountAmount(); $cartRules = $quote->getCartFixedRules(); if (!isset($cartRules[$rule->getId()])) { @@ -101,17 +104,17 @@ public function calculate($rule, $item, $qty) if ($availableDiscountAmount > 0) { $store = $quote->getStore(); - if ($ruleTotals['items_count'] <= 1) { - $baseRuleTotals = $shippingMethod ? - $this->cartFixedDiscountHelper - ->getBaseRuleTotals( - $isAppliedToShipping, - $quote, - $isMultiShipping, - $address, - $baseRuleTotals - ) : $baseRuleTotals; - $maximumItemDiscount = $this->cartFixedDiscountHelper + $baseRuleTotals = $shippingMethod ? + $this->cartFixedDiscountHelper + ->getBaseRuleTotals( + $isAppliedToShipping, + $quote, + $isMultiShipping, + $address, + $baseRuleTotals + ) : $baseRuleTotals; + if ($isAppliedToShipping) { + $baseDiscountAmount = $this->cartFixedDiscountHelper ->getDiscountAmount( $ruleDiscount, $qty, @@ -119,29 +122,22 @@ public function calculate($rule, $item, $qty) $baseRuleTotals, $discountType ); - $quoteAmount = $this->priceCurrency->convert($maximumItemDiscount, $store); - $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); - $this->deltaPriceRound->reset($discountType); } else { - $baseRuleTotals = $shippingMethod ? - $this->cartFixedDiscountHelper - ->getBaseRuleTotals( - $isAppliedToShipping, - $quote, - $isMultiShipping, - $address, - $baseRuleTotals - ) : $baseRuleTotals; - $maximumItemDiscount =$this->cartFixedDiscountHelper - ->getDiscountAmount( + $baseDiscountAmount = $this->cartFixedDiscountHelper + ->getDiscountedAmountProportionally( $ruleDiscount, $qty, $baseItemPrice, - $baseRuleTotals, + $baseItemDiscountAmount, + $baseRuleTotals - $baseRuleTotalsDiscount, $discountType ); - $quoteAmount = $this->priceCurrency->convert($maximumItemDiscount, $store); - $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); + } + $discountAmount = $this->priceCurrency->convert($baseDiscountAmount, $store); + $baseDiscountAmount = min($baseItemPrice * $qty, $baseDiscountAmount); + if ($ruleItemsCount <= 1) { + $this->deltaPriceRound->reset($discountType); + } else { $this->validator->decrementRuleItemTotalsCount($rule->getId()); } @@ -162,24 +158,24 @@ public function calculate($rule, $item, $qty) $ruleTotals['items_count'] <= 1) { $estimatedShippingAmount = (float) $address->getBaseShippingInclTax(); $shippingDiscountAmount = $this->cartFixedDiscountHelper-> - getShippingDiscountAmount( - $rule, - $estimatedShippingAmount, - $baseRuleTotals - ); + getShippingDiscountAmount( + $rule, + $estimatedShippingAmount, + $baseRuleTotals + ); $cartRules[$rule->getId()] -= $shippingDiscountAmount; if ($cartRules[$rule->getId()] < 0.0) { $baseDiscountAmount += $cartRules[$rule->getId()]; - $quoteAmount += $cartRules[$rule->getId()]; + $discountAmount += $cartRules[$rule->getId()]; } } if ($availableDiscountAmount <= 0) { $this->deltaPriceRound->reset($discountType); } - $discountData->setAmount($this->priceCurrency->roundPrice(min($itemPrice * $qty, $quoteAmount))); + $discountData->setAmount($this->priceCurrency->roundPrice(min($itemPrice * $qty, $discountAmount))); $discountData->setBaseAmount($baseDiscountAmount); - $discountData->setOriginalAmount(min($itemOriginalPrice * $qty, $quoteAmount)); + $discountData->setOriginalAmount(min($itemOriginalPrice * $qty, $discountAmount)); $discountData->setBaseOriginalAmount($this->priceCurrency->roundPrice($baseItemOriginalPrice)); } $quote->setCartFixedRules($cartRules); diff --git a/app/code/Magento/SalesRule/Model/RulesApplier.php b/app/code/Magento/SalesRule/Model/RulesApplier.php index cde8e5c065502..3652f22798c14 100644 --- a/app/code/Magento/SalesRule/Model/RulesApplier.php +++ b/app/code/Magento/SalesRule/Model/RulesApplier.php @@ -10,7 +10,6 @@ use Magento\SalesRule\Model\Data\RuleDiscount; use Magento\SalesRule\Model\Quote\ChildrenValidationLocator; use Magento\Framework\App\ObjectManager; -use Magento\SalesRule\Model\ResourceModel\Rule\Collection; use Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory; use Magento\SalesRule\Model\Rule\Action\Discount\Data; use Magento\SalesRule\Model\Rule\Action\Discount\DataFactory; @@ -99,7 +98,7 @@ public function __construct( * Apply rules to current order item * * @param AbstractItem $item - * @param Collection $rules + * @param array $rules * @param bool $skipValidation * @param mixed $couponCode * @return array @@ -109,10 +108,6 @@ public function applyRules($item, $rules, $skipValidation, $couponCode) { $address = $item->getAddress(); $appliedRuleIds = []; - $this->discountAggregator = []; - if ($item->getExtensionAttributes()) { - $item->getExtensionAttributes()->setDiscounts(null); - } /* @var $rule Rule */ foreach ($rules as $rule) { if (!$this->validatorUtility->canProcessRule($rule, $address)) { @@ -138,10 +133,6 @@ public function applyRules($item, $rules, $skipValidation, $couponCode) $this->applyRule($item, $rule, $address, $couponCode); $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId(); - - if ($rule->getStopRulesProcessing()) { - break; - } } return $appliedRuleIds; @@ -270,10 +261,9 @@ private function setDiscountBreakdown($discountData, $item, $rule, $address) ]; /** @var RuleDiscount $itemDiscount */ $ruleDiscount = $this->discountInterfaceFactory->create(['data' => $data]); - $this->discountAggregator[] = $ruleDiscount; - $item->getExtensionAttributes()->setDiscounts($this->discountAggregator); + $this->discountAggregator[$item->getId()][$rule->getId()] = $ruleDiscount; + $item->getExtensionAttributes()->setDiscounts(array_values($this->discountAggregator[$item->getId()])); $parentItem = $item->getParentItem(); - if ($parentItem && $parentItem->getExtensionAttributes()) { $this->aggregateDiscountBreakdown($discountData, $parentItem, $rule, $address); } @@ -281,6 +271,14 @@ private function setDiscountBreakdown($discountData, $item, $rule, $address) return $this; } + /** + * Reset discount aggregator + */ + public function resetDiscountAggregator() + { + $this->discountAggregator = []; + } + /** * Add Discount Breakdown to existing discount data * @@ -413,7 +411,7 @@ public function setAppliedRuleIds(AbstractItem $item, array $appliedRuleIds) $address = $item->getAddress(); $quote = $item->getQuote(); - $item->setAppliedRuleIds(join(',', $appliedRuleIds)); + $item->setAppliedRuleIds($this->validatorUtility->mergeIds($item->getAppliedRuleIds(), $appliedRuleIds)); $address->setAppliedRuleIds($this->validatorUtility->mergeIds($address->getAppliedRuleIds(), $appliedRuleIds)); $quote->setAppliedRuleIds($this->validatorUtility->mergeIds($quote->getAppliedRuleIds(), $appliedRuleIds)); diff --git a/app/code/Magento/SalesRule/Model/Validator.php b/app/code/Magento/SalesRule/Model/Validator.php index 7b3a6b15b7a32..26fb7ee721732 100644 --- a/app/code/Magento/SalesRule/Model/Validator.php +++ b/app/code/Magento/SalesRule/Model/Validator.php @@ -12,6 +12,7 @@ use Magento\Quote\Model\Quote\Item\AbstractItem; use Magento\SalesRule\Helper\CartFixedDiscount; use Magento\SalesRule\Model\ResourceModel\Rule\CollectionFactory; +use Magento\SalesRule\Model\ResourceModel\Rule\Collection as RulesCollection; /** * SalesRule Validator Model @@ -31,7 +32,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel /** * Rule source collection * - * @var \Magento\SalesRule\Model\ResourceModel\Rule\Collection + * @var RulesCollection */ protected $_rules; @@ -58,7 +59,7 @@ class Validator extends \Magento\Framework\Model\AbstractModel protected $_skipActionsValidation = false; /** - * Catalog data + * Catalog data helper * * @var \Magento\Catalog\Helper\Data|null */ @@ -169,11 +170,24 @@ public function init($websiteId, $customerGroupId, $couponCode) /** * Get rules collection for current object state * + * @deprecated use getRules * @param Address|null $address - * @return \Magento\SalesRule\Model\ResourceModel\Rule\Collection + * @return RulesCollection * @throws \Zend_Db_Select_Exception */ protected function _getRules(Address $address = null) + { + return $this->getRules($address); + } + + /** + * Get rules collection for current object state + * + * @param Address|null $address + * @return RulesCollection + * @throws \Zend_Db_Select_Exception + */ + public function getRules(Address $address = null) { $addressId = $this->getAddressId($address); $key = $this->getWebsiteId() . '_' @@ -240,7 +254,7 @@ public function setSkipActionsValidation($flag) public function canApplyRules(AbstractItem $item) { $address = $item->getAddress(); - foreach ($this->_getRules($address) as $rule) { + foreach ($this->getRules($address) as $rule) { if (!$this->validatorUtility->canProcessRule($rule, $address) || !$rule->getActions()->validate($item)) { return false; } @@ -260,6 +274,7 @@ public function reset(Address $address) $this->validatorUtility->resetRoundingDeltas(); $address->setBaseSubtotalWithDiscount($address->getBaseSubtotal()); $address->setSubtotalWithDiscount($address->getSubtotal()); + $this->rulesApplier->resetDiscountAggregator(); if ($this->_isFirstTimeResetRun) { $address->setAppliedRuleIds(''); $address->getQuote()->setAppliedRuleIds(''); @@ -273,22 +288,12 @@ public function reset(Address $address) * Quote item discount calculation process * * @param AbstractItem $item + * @param Rule $rule * @return $this * @throws \Zend_Db_Select_Exception */ - public function process(AbstractItem $item) + public function process(AbstractItem $item, Rule $rule) { - $item->setDiscountAmount(0); - $item->setBaseDiscountAmount(0); - $item->setDiscountPercent(0); - if ($item->getChildren() && $item->isChildrenCalculated()) { - foreach ($item->getChildren() as $child) { - $child->setDiscountAmount(0); - $child->setBaseDiscountAmount(0); - $child->setDiscountPercent(0); - } - } - $itemPrice = $this->getItemPrice($item); if ($itemPrice < 0) { return $this; @@ -296,7 +301,7 @@ public function process(AbstractItem $item) $appliedRuleIds = $this->rulesApplier->applyRules( $item, - $this->_getRules($item->getAddress()), + [$rule], $this->_skipActionsValidation, $this->getCouponCode() ); @@ -326,7 +331,7 @@ public function processShippingAmount(Address $address) } $quote = $address->getQuote(); $appliedRuleIds = []; - foreach ($this->_getRules($address) as $rule) { + foreach ($this->getRules($address) as $rule) { /* @var Rule $rule */ if (!$rule->getApplyToShipping() || !$this->validatorUtility->canProcessRule($rule, $address)) { continue; @@ -429,43 +434,51 @@ public function processShippingAmount(Address $address) * @param mixed $items * @param Address $address * @return $this + * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @throws \Zend_Validate_Exception * @throws \Zend_Db_Select_Exception */ public function initTotals($items, Address $address) { - $address->setCartFixedRules([]); - if (!$items) { return $this; } /** @var Rule $rule */ - foreach ($this->_getRules($address) as $rule) { - if (Rule::CART_FIXED_ACTION == $rule->getSimpleAction() - && $this->validatorUtility->canProcessRule($rule, $address) + foreach ($this->getRules($address) as $rule) { + if (Rule::CART_FIXED_ACTION !== $rule->getSimpleAction() + || !$this->validatorUtility->canProcessRule($rule, $address) ) { - $ruleTotalItemsPrice = 0; - $ruleTotalBaseItemsPrice = 0; - $validItemsCount = 0; - - foreach ($items as $item) { - //Skipping child items to avoid double calculations - if (!$this->isValidItemForRule($item, $rule)) { - continue; - } - $qty = $this->validatorUtility->getItemQty($item, $rule); - $ruleTotalItemsPrice += $this->getItemPrice($item) * $qty; - $ruleTotalBaseItemsPrice += $this->getItemBasePrice($item) * $qty; - $validItemsCount++; + continue; + } + $ruleTotalItemsPrice = 0; + $ruleTotalBaseItemsPrice = 0; + $ruleTotalItemsDiscountAmount = 0; + $ruleTotalBaseItemsDiscountAmount = 0; + $validItemsCount = 0; + + foreach ($items as $item) { + if (!$this->isValidItemForRule($item, $rule) + || ($item->getChildren() && $item->isChildrenCalculated()) + || $item->getNoDiscount() + ) { + continue; } - - $this->_rulesItemTotals[$rule->getId()] = [ - 'items_price' => $ruleTotalItemsPrice, - 'base_items_price' => $ruleTotalBaseItemsPrice, - 'items_count' => $validItemsCount, - ]; + $qty = $this->validatorUtility->getItemQty($item, $rule); + $ruleTotalItemsPrice += $this->getItemPrice($item) * $qty; + $ruleTotalBaseItemsPrice += $this->getItemBasePrice($item) * $qty; + $ruleTotalItemsDiscountAmount += $item->getDiscountAmount(); + $ruleTotalBaseItemsDiscountAmount += $item->getBaseDiscountAmount(); + $validItemsCount++; } + + $this->_rulesItemTotals[$rule->getId()] = [ + 'items_price' => $ruleTotalItemsPrice, + 'items_discount_amount' => $ruleTotalItemsDiscountAmount, + 'base_items_price' => $ruleTotalBaseItemsPrice, + 'base_items_discount_amount' => $ruleTotalBaseItemsDiscountAmount, + 'items_count' => $validItemsCount, + ]; } return $this; @@ -480,12 +493,6 @@ public function initTotals($items, Address $address) */ private function isValidItemForRule(AbstractItem $item, Rule $rule) { - if ($item->getParentItemId()) { - return false; - } - if ($item->getParentItem()) { - return false; - } if (!$rule->getActions()->validate($item)) { return false; } @@ -613,7 +620,7 @@ public function sortItemsByPriority($items, Address $address = null) { $itemsSorted = []; /** @var $rule Rule */ - foreach ($this->_getRules($address) as $rule) { + foreach ($this->getRules($address) as $rule) { foreach ($items as $itemKey => $itemValue) { if ($rule->getActions()->validate($itemValue)) { unset($items[$itemKey]); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php index 5633bd788de86..5a7d6142a6d43 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php @@ -9,20 +9,24 @@ use Magento\Framework\Api\ExtensionAttributesInterface; use Magento\Framework\Event\Manager; +use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Pricing\PriceCurrencyInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Quote\Api\Data\ShippingAssignmentInterface; use Magento\Quote\Api\Data\ShippingInterface; use Magento\Quote\Model\Quote; use Magento\Quote\Model\Quote\Address; use Magento\Quote\Model\Quote\Address\Total; use Magento\Quote\Model\Quote\Item; +use Magento\SalesRule\Api\Data\DiscountDataInterfaceFactory; +use Magento\SalesRule\Api\Data\RuleDiscountInterfaceFactory; use Magento\SalesRule\Model\Quote\Discount; use Magento\SalesRule\Model\Rule\Action\Discount\Data; use Magento\SalesRule\Model\Rule\Action\Discount\DataFactory; +use Magento\SalesRule\Model\RulesApplier; use Magento\SalesRule\Model\Validator; use Magento\Store\Model\Store; -use Magento\Store\Model\StoreManager; +use Magento\SalesRule\Model\Rule; +use Magento\Store\Model\StoreManagerInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -36,11 +40,6 @@ class DiscountTest extends TestCase */ protected $discount; - /** - * @var ObjectManager - */ - protected $objectManager; - /** * @var MockObject */ @@ -71,13 +70,36 @@ class DiscountTest extends TestCase */ private $discountFactory; + /** + * @var Rule|MockObject + */ + private $rule; + + /** + * @var RuleDiscountInterfaceFactory|MockObject + */ + private $discountInterfaceFactoryMock; + + /** + * @var DiscountDataInterfaceFactory|MockObject + */ + private $discountDataInterfaceFactoryMock; + + /** + * @var RulesApplier|MockObject + */ + private $rulesApplierMock; + protected function setUp(): void { - $this->objectManager = new ObjectManager($this); - $this->storeManagerMock = $this->createMock(StoreManager::class); + $this->storeManagerMock = $this->getMockForAbstractClass(StoreManagerInterface::class); + $this->eventManagerMock = $this->getMockForAbstractClass(ManagerInterface::class); + $this->discountInterfaceFactoryMock = $this->createMock(RuleDiscountInterfaceFactory::class); + $this->discountDataInterfaceFactoryMock = $this->createMock(DiscountDataInterfaceFactory::class); + $this->rulesApplierMock = $this->createMock(RulesApplier::class); $this->validatorMock = $this->getMockBuilder(Validator::class) ->disableOriginalConstructor() - ->setMethods( + ->onlyMethods( [ 'canApplyRules', 'reset', @@ -88,6 +110,16 @@ protected function setUp(): void 'process', 'processShippingAmount', 'canApplyDiscount', + 'getRules', + 'prepareDescription' + ] + ) + ->getMock(); + $this->rule = $this->getMockBuilder(Rule::class) + ->disableOriginalConstructor() + ->addMethods( + [ + 'getSimpleAction' ] ) ->getMock(); @@ -108,7 +140,7 @@ function ($argument) { ->getMock(); $addressExtension = $this->getMockBuilder( ExtensionAttributesInterface::class - )->setMethods(['setDiscounts', 'getDiscounts'])->getMock(); + )->addMethods(['setDiscounts', 'getDiscounts'])->getMockForAbstractClass(); $addressExtension->method('getDiscounts')->willReturn([]); $addressExtension->expects($this->any()) ->method('setDiscounts') @@ -130,14 +162,14 @@ function ($argument) { ); /** @var Discount $discount */ - $this->discount = $this->objectManager->getObject( - Discount::class, - [ - 'storeManager' => $this->storeManagerMock, - 'validator' => $this->validatorMock, - 'eventManager' => $this->eventManagerMock, - 'priceCurrency' => $priceCurrencyMock, - ] + $this->discount = new Discount( + $this->eventManagerMock, + $this->storeManagerMock, + $this->validatorMock, + $priceCurrencyMock, + $this->discountInterfaceFactoryMock, + $this->discountDataInterfaceFactoryMock, + $this->rulesApplierMock ); $discountData = $this->getMockBuilder(Data::class) ->getMock(); @@ -151,29 +183,38 @@ public function testCollectItemNoDiscount() { $itemNoDiscount = $this->getMockBuilder(Item::class) ->addMethods(['getNoDiscount']) - ->onlyMethods(['getExtensionAttributes']) + ->onlyMethods(['getExtensionAttributes', 'getParentItem', 'getId']) ->disableOriginalConstructor() ->getMock(); $itemExtension = $this->getMockBuilder( ExtensionAttributesInterface::class - )->setMethods(['setDiscounts', 'getDiscounts'])->getMock(); + )->addMethods(['setDiscounts', 'getDiscounts'])->getMockForAbstractClass(); $itemExtension->method('getDiscounts')->willReturn([]); $itemExtension->expects($this->any()) ->method('setDiscounts') ->willReturn([]); - $itemNoDiscount->expects( - $this->any() - )->method('getExtensionAttributes')->willReturn($itemExtension); + $itemNoDiscount->expects($this->any())->method('getExtensionAttributes')->willReturn($itemExtension); + $itemNoDiscount->expects($this->any())->method('getId')->willReturn(1); $itemNoDiscount->expects($this->once())->method('getNoDiscount')->willReturn(true); $this->validatorMock->expects($this->once())->method('sortItemsByPriority') ->with([$itemNoDiscount], $this->addressMock) ->willReturnArgument(0); + $this->validatorMock->expects($this->once())->method('getRules') + ->with($this->addressMock) + ->willReturn([$this->rule]); + $this->rule->expects($this->any())->method('getSimpleAction') + ->willReturn(null); $storeMock = $this->getMockBuilder(Store::class) ->addMethods(['getStore']) ->disableOriginalConstructor() ->getMock(); $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($storeMock); - $quoteMock = $this->createMock(Quote::class); + $quoteMock = $this->getMockBuilder(Quote::class) + ->onlyMethods(['getAllAddresses', 'getStoreId']) + ->disableOriginalConstructor() + ->getMock(); + $quoteMock->expects($this->any())->method('getAllAddresses')->willReturn([$this->addressMock]); + $this->addressMock->expects($this->any())->method('getAllItems')->willReturn([$itemNoDiscount]); $this->addressMock->expects($this->any())->method('getQuote')->willReturn($quoteMock); $this->shippingAssignmentMock->expects($this->any())->method('getItems')->willReturn([$itemNoDiscount]); $this->addressMock->expects($this->any())->method('getShippingAmount')->willReturn(true); @@ -190,16 +231,23 @@ public function testCollectItemHasParent() { $itemWithParentId = $this->getMockBuilder(Item::class) ->addMethods(['getNoDiscount']) - ->onlyMethods(['getParentItem']) + ->onlyMethods(['getParentItem', 'getId', 'getExtensionAttributes']) ->disableOriginalConstructor() ->getMock(); $itemWithParentId->expects($this->once())->method('getNoDiscount')->willReturn(false); - $itemWithParentId->expects($this->once())->method('getParentItem')->willReturn(true); + $itemWithParentId->expects($this->any())->method('getId')->willReturn(1); + $itemWithParentId->expects($this->any())->method('getParentItem')->willReturn(true); + $itemWithParentId->expects($this->any())->method('getExtensionAttributes')->willReturn(false); $this->validatorMock->expects($this->any())->method('canApplyDiscount')->willReturn(true); $this->validatorMock->expects($this->any())->method('sortItemsByPriority') ->with([$itemWithParentId], $this->addressMock) ->willReturnArgument(0); + $this->validatorMock->expects($this->once())->method('getRules') + ->with($this->addressMock) + ->willReturn([$this->rule]); + $this->rule->expects($this->any())->method('getSimpleAction') + ->willReturn(null); $storeMock = $this->getMockBuilder(Store::class) ->addMethods(['getStore']) @@ -207,7 +255,12 @@ public function testCollectItemHasParent() ->getMock(); $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($storeMock); - $quoteMock = $this->createMock(Quote::class); + $quoteMock = $this->getMockBuilder(Quote::class) + ->onlyMethods(['getAllAddresses', 'getStoreId']) + ->disableOriginalConstructor() + ->getMock(); + $quoteMock->expects($this->any())->method('getAllAddresses')->willReturn([$this->addressMock]); + $this->addressMock->expects($this->any())->method('getAllItems')->willReturn([$itemWithParentId]); $this->addressMock->expects($this->any())->method('getQuote')->willReturn($quoteMock); $this->addressMock->expects($this->any())->method('getShippingAmount')->willReturn(true); @@ -224,35 +277,46 @@ public function testCollectItemHasNoChildren() { $itemWithChildren = $this->getMockBuilder(Item::class) ->disableOriginalConstructor() - ->setMethods( + ->onlyMethods( [ - 'getNoDiscount', 'getParentItem', - 'getHasChildren', 'isChildrenCalculated', 'getChildren', 'getExtensionAttributes', + 'getId', + ] + )->addMethods( + [ + 'getNoDiscount', + 'getHasChildren', ] ) ->getMock(); $itemExtension = $this->getMockBuilder( ExtensionAttributesInterface::class - )->setMethods(['setDiscounts', 'getDiscounts'])->getMock(); + )->addMethods(['setDiscounts', 'getDiscounts', 'getId'])->getMock(); $itemExtension->method('getDiscounts')->willReturn([]); $itemExtension->expects($this->any()) ->method('setDiscounts') ->willReturn([]); + $itemExtension->expects($this->any())->method('getId')->willReturn(1); $itemWithChildren->expects( $this->any() )->method('getExtensionAttributes')->willReturn($itemExtension); $itemWithChildren->expects($this->once())->method('getNoDiscount')->willReturn(false); - $itemWithChildren->expects($this->once())->method('getParentItem')->willReturn(false); + $itemWithChildren->expects($this->any())->method('getParentItem')->willReturn(false); $itemWithChildren->expects($this->once())->method('getHasChildren')->willReturn(false); + $itemWithChildren->expects($this->any())->method('getId')->willReturn(2); $this->validatorMock->expects($this->any())->method('canApplyDiscount')->willReturn(true); $this->validatorMock->expects($this->once())->method('sortItemsByPriority') ->with([$itemWithChildren], $this->addressMock) ->willReturnArgument(0); + $this->validatorMock->expects($this->once())->method('getRules') + ->with($this->addressMock) + ->willReturn([$this->rule]); + $this->rule->expects($this->any())->method('getSimpleAction') + ->willReturn(null); $storeMock = $this->getMockBuilder(Store::class) ->disableOriginalConstructor() @@ -261,8 +325,11 @@ public function testCollectItemHasNoChildren() $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($storeMock); $quoteMock = $this->getMockBuilder(Quote::class) + ->onlyMethods(['getAllAddresses', 'getStoreId']) ->disableOriginalConstructor() ->getMock(); + $quoteMock->expects($this->any())->method('getAllAddresses')->willReturn([$this->addressMock]); + $this->addressMock->expects($this->any())->method('getAllItems')->willReturn([$itemWithChildren]); $this->addressMock->expects($this->any())->method('getQuote')->willReturn($quoteMock); $this->addressMock->expects($this->any())->method('getShippingAmount')->willReturn(true); $this->shippingAssignmentMock->expects($this->any())->method('getItems')->willReturn([$itemWithChildren]); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Action/Discount/CartFixedTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Action/Discount/CartFixedTest.php index 276a308980683..1889febcedd38 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Action/Discount/CartFixedTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Action/Discount/CartFixedTest.php @@ -121,9 +121,10 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMock(); $this->cartFixedDiscountHelper = $this->getMockBuilder(CartFixedDiscount::class) - ->setMethods([ + ->onlyMethods([ 'calculateShippingAmountWhenAppliedToShipping', 'getDiscountAmount', + 'getDiscountedAmountProportionally', 'checkMultiShippingQuote', 'getQuoteTotalsForMultiShipping', 'getQuoteTotalsForRegularShipping', @@ -170,7 +171,7 @@ public function testCalculate(array $shipping, array $ruleDetails): void ); $this->cartFixedDiscountHelper ->expects($this->any()) - ->method('getDiscountAmount') + ->method('getDiscountedAmountProportionally') ->will( $this->returnValue( $ruleDetails['discounted_amount'] diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php index 50824a87316cb..af6f41cee2294 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php @@ -98,7 +98,7 @@ protected function setUp(): void * @return void * @dataProvider dataProviderChildren */ - public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed( + public function testApplyRules( bool $isChildren, bool $isContinue ): void { @@ -116,30 +116,19 @@ public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed( ->with($this->anything()) ->willReturn($discountData); /** - * @var Rule|MockObject $ruleWithStopFurtherProcessing + * @var Rule|MockObject $rule */ - $ruleWithStopFurtherProcessing = $this->getMockBuilder(Rule::class) + $rule = $this->getMockBuilder(Rule::class) ->addMethods(['getCouponType', 'getRuleId']) ->onlyMethods(['getStoreLabel', 'getActions']) ->disableOriginalConstructor() ->getMock(); - /** - * @var Rule|MockObject $ruleThatShouldNotBeRun - */ - $ruleThatShouldNotBeRun = $this->getMockBuilder(Rule::class) - ->addMethods(['getStopRulesProcessing']) - ->disableOriginalConstructor() - ->getMock(); $actionMock = $this->getMockBuilder(Collection::class) ->addMethods(['validate']) ->disableOriginalConstructor() ->getMock(); - $ruleWithStopFurtherProcessing->setName('ruleWithStopFurtherProcessing'); - $ruleThatShouldNotBeRun->setName('ruleThatShouldNotBeRun'); - $rules = [$ruleWithStopFurtherProcessing, $ruleThatShouldNotBeRun]; - $item->setDiscountCalculationPrice($positivePrice); $item->setData('calculation_price', $positivePrice); @@ -151,7 +140,7 @@ public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed( ->method('canProcessRule') ->willReturn(true); - $ruleWithStopFurtherProcessing->expects($this->atLeastOnce()) + $rule->expects($this->atLeastOnce()) ->method('getActions') ->willReturn($actionMock); @@ -174,18 +163,14 @@ public function testApplyRulesWhenRuleWithStopRulesProcessingIsUsed( } if (!$isContinue || !$isChildren) { - $ruleWithStopFurtherProcessing->expects($this->any()) + $rule->expects($this->any()) ->method('getRuleId') ->willReturn($ruleId); - $this->applyRule($item, $ruleWithStopFurtherProcessing); - - $ruleWithStopFurtherProcessing->setStopRulesProcessing(true); - $ruleThatShouldNotBeRun->expects($this->never()) - ->method('getStopRulesProcessing'); + $this->applyRule($item, $rule); } - $result = $this->rulesApplier->applyRules($item, $rules, $skipValidation, $couponCode); + $result = $this->rulesApplier->applyRules($item, [$rule], $skipValidation, $couponCode); $this->assertEquals($appliedRuleIds, $result); } diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php index 993ee04a6aaf4..82ca394effff5 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/ValidatorTest.php @@ -274,6 +274,7 @@ public function testProcess(): void { $negativePrice = -1; + $rule = $this->createMock(Rule::class); $this->item->setDiscountCalculationPrice($negativePrice); $this->item->setData('calculation_price', $negativePrice); @@ -284,34 +285,7 @@ public function testProcess(): void $this->model->getCustomerGroupId(), $this->model->getCouponCode() ); - $this->model->process($this->item); - } - - /** - * @return void - */ - public function testProcessWhenItemPriceIsNegativeDiscountsAreZeroed(): void - { - $negativePrice = -1; - $nonZeroDiscount = 123; - $this->model->init( - $this->model->getWebsiteId(), - $this->model->getCustomerGroupId(), - $this->model->getCouponCode() - ); - - $this->item->setDiscountCalculationPrice($negativePrice); - $this->item->setData('calculation_price', $negativePrice); - - $this->item->setDiscountAmount($nonZeroDiscount); - $this->item->setBaseDiscountAmount($nonZeroDiscount); - $this->item->setDiscountPercent($nonZeroDiscount); - - $this->model->process($this->item); - - $this->assertEquals(0, $this->item->getDiscountAmount()); - $this->assertEquals(0, $this->item->getBaseDiscountAmount()); - $this->assertEquals(0, $this->item->getDiscountPercent()); + $this->model->process($this->item, $rule); } /** @@ -328,6 +302,7 @@ public function testApplyRulesThatAppliedRuleIdsAreCollected(): void $this->model->getCustomerGroupId(), $this->model->getCouponCode() ); + $rule = $this->createMock(Rule::class); $this->item->setDiscountCalculationPrice($positivePrice); $this->item->setData('calculation_price', $positivePrice); @@ -337,7 +312,7 @@ public function testApplyRulesThatAppliedRuleIdsAreCollected(): void ->method('applyRules') ->with( $this->item, - $this->ruleCollection, + [$rule], $this->anything(), $this->anything() ) @@ -349,7 +324,7 @@ public function testApplyRulesThatAppliedRuleIdsAreCollected(): void $expectedRuleIds ); - $this->model->process($this->item); + $this->model->process($this->item, $rule); } /** diff --git a/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls b/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls index f4967779f3822..3b577d6222f5b 100644 --- a/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SendFriendGraphQl/etc/schema.graphqls @@ -2,47 +2,47 @@ # See COPYING.txt for license details. type Mutation { - sendEmailToFriend (input: SendEmailToFriendInput): SendEmailToFriendOutput @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendEmailToFriend") @doc(description:"Recommends Product by Sending Single/Multiple Email") + sendEmailToFriend (input: SendEmailToFriendInput @doc(description: "An input object that defines sender, recipients, and product.")): SendEmailToFriendOutput @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendEmailToFriend") @doc(description: "Send a message on behalf of a customer to the specified email addresses.") } -input SendEmailToFriendInput { - product_id: Int! - sender: SendEmailToFriendSenderInput! - recipients: [SendEmailToFriendRecipientInput!]! +input SendEmailToFriendInput @doc(description: "Defines the referenced product and the email sender and recipients.") { + product_id: Int! @doc(description: "The ID of the product that the sender is referencing.") + sender: SendEmailToFriendSenderInput! @doc(description: "Information about the customer and the content of the message.") + recipients: [SendEmailToFriendRecipientInput!]! @doc(description: "An array containing information about each recipient.") } -input SendEmailToFriendSenderInput { - name: String! - email: String! - message: String! +input SendEmailToFriendSenderInput @doc(description: "Contains details about the sender.") { + name: String! @doc(description: "The name of the sender.") + email: String! @doc(description: "The email address of the sender.") + message: String! @doc(description: "The text of the message to be sent.") } -input SendEmailToFriendRecipientInput { - name: String! - email: String! +input SendEmailToFriendRecipientInput @doc(description: "Contains details about a recipient.") { + name: String! @doc(description: "The name of the recipient.") + email: String! @doc(description: "The email address of the recipient.") } -type SendEmailToFriendOutput { - sender: SendEmailToFriendSender - recipients: [SendEmailToFriendRecipient] +type SendEmailToFriendOutput @doc(description: "Contains information about the sender and recipients.") { + sender: SendEmailToFriendSender @doc(description: "Information about the customer and the content of the message.") + recipients: [SendEmailToFriendRecipient] @doc(description: "An array containing information about each recipient.") } -type SendEmailToFriendSender { - name: String! - email: String! - message: String! +type SendEmailToFriendSender @doc(description: "An output object that contains information about the sender.") { + name: String! @doc(description: "The name of the sender.") + email: String! @doc(description: "The email address of the sender.") + message: String! @doc(description: "The text of the message to be sent.") } -type SendEmailToFriendRecipient { - name: String! - email: String! +type SendEmailToFriendRecipient @doc(description: "An output object that contains information about the recipient.") { + name: String! @doc(description: "The name of the recipient.") + email: String! @doc(description: "The email address of the recipient.") } type StoreConfig { send_friend: SendFriendConfiguration @resolver(class: "\\Magento\\SendFriendGraphQl\\Model\\Resolver\\SendFriendConfiguration") @doc(description: "Email to a Friend configuration.") } -type SendFriendConfiguration { +type SendFriendConfiguration @doc(description: "Contains details about the configuration of the Email to a Friend feature.") { enabled_for_customers: Boolean! @doc(description: "Indicates whether the Email to a Friend feature is enabled.") enabled_for_guests: Boolean! @doc(description: "Indicates whether the Email to a Friend feature is enabled for guests.") } diff --git a/app/code/Magento/StoreGraphQl/etc/schema.graphqls b/app/code/Magento/StoreGraphQl/etc/schema.graphqls index 9efdb5a210403..2a6c030aacb7c 100644 --- a/app/code/Magento/StoreGraphQl/etc/schema.graphqls +++ b/app/code/Magento/StoreGraphQl/etc/schema.graphqls @@ -1,46 +1,46 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. type Query { - storeConfig : StoreConfig @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\StoreConfigResolver") @doc(description: "The store config query") @cache(cacheable: false) + storeConfig : StoreConfig @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\StoreConfigResolver") @doc(description: "Return details about the store's configuration.") @cache(cacheable: false) availableStores( - useCurrentGroup: Boolean @doc(description: "Filter store views by current store group") + useCurrentGroup: Boolean @doc(description: "Filter store views by the current store group.") ): [StoreConfig] @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\AvailableStoresResolver") @doc(description: "Get a list of available store views and their config information.") } -type Website @doc(description: "Website is deprecated because it is should not be used on storefront. The type contains information about a website") { - id : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The ID number assigned to the website") +type Website @doc(description: "Deprecated. It should not be used on the storefront. Contains information about a website.") { + id : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The ID number assigned to the website.") name : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The website name. Websites use this name to identify it easier.") - code : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "A code assigned to the website to identify it") - sort_order : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The attribute to use for sorting websites") - default_group_id : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The default group ID that the website has") - is_default : Boolean @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Specifies if this is the default website") + code : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "A code assigned to the website to identify it.") + sort_order : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The attribute to use for sorting websites.") + default_group_id : String @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The default group ID of the website.") + is_default : Boolean @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "Indicates whether this is the default website.") } -type StoreConfig @doc(description: "The type contains information about a store config") { - id : Int @deprecated(reason: "Use `store_code` instead.") @doc(description: "The ID number assigned to the store") - code : String @deprecated(reason: "Use `store_code` instead.") @doc(description: "A code assigned to the store to identify it") - store_code: ID @doc(description: "The unique ID of the store view. In the Admin, this is called the Store View Code. When making a GraphQL call, assign this value to the `Store` header to provide the scope") - store_name : String @doc(description: "The label assigned to the store view") - store_sort_order : Int @doc(description: "The store view sort order") - is_default_store : Boolean @doc(description: "Indicates whether the store view has been designated as the default within the store group") - store_group_code : ID @doc(description: "The unique ID assigned to the store group. In the Admin, this is called the Store Name") - store_group_name : String @doc(description: "The label assigned to the store group") - is_default_store_group : Boolean @doc(description: "Indicates whether the store group has been designated as the default within the website") - website_id : Int @deprecated(reason: "The field should not be used on the storefront") @doc(description: "The ID number assigned to the website store") - website_code : ID @doc(description: "The unique ID for the website") - website_name : String @doc(description: "The label assigned to the website") - locale : String @doc(description: "Store locale") - base_currency_code : String @doc(description: "Base currency code") - default_display_currency_code : String @doc(description: "Default display currency code") - timezone : String @doc(description: "Timezone of the store") - weight_unit : String @doc(description: "The unit of weight") - base_url : String @doc(description: "Base URL for the store") - base_link_url : String @doc(description: "Base link URL for the store") - base_static_url : String @doc(description: "Base static URL for the store") - base_media_url : String @doc(description: "Base media URL for the store") - secure_base_url : String @doc(description: "Secure base URL for the store") - secure_base_link_url : String @doc(description: "Secure base link URL for the store") - secure_base_static_url : String @doc(description: "Secure base static URL for the store") - secure_base_media_url : String @doc(description: "Secure base media URL for the store") - use_store_in_url: Boolean @doc(description: "The configuration determines if the store code should be used in the URL") +type StoreConfig @doc(description: "Contains information about a store's configuration.") { + id : Int @deprecated(reason: "Use `store_code` instead.") @doc(description: "The ID number assigned to the store.") + code : String @deprecated(reason: "Use `store_code` instead.") @doc(description: "A code assigned to the store to identify it.") + store_code: ID @doc(description: "The unique ID of the store view. In the Admin, this is called the Store View Code. When making a GraphQL call, assign this value to the `Store` header to provide the scope.") + store_name : String @doc(description: "The label assigned to the store view.") + store_sort_order : Int @doc(description: "The store view sort order.") + is_default_store : Boolean @doc(description: "Indicates whether the store view has been designated as the default within the store group.") + store_group_code : ID @doc(description: "The unique ID assigned to the store group. In the Admin, this is called the Store Name.") + store_group_name : String @doc(description: "The label assigned to the store group.") + is_default_store_group : Boolean @doc(description: "Indicates whether the store group has been designated as the default within the website.") + website_id : Int @deprecated(reason: "The field should not be used on the storefront.") @doc(description: "The ID number assigned to the website store.") + website_code : ID @doc(description: "The unique ID for the website.") + website_name : String @doc(description: "The label assigned to the website.") + locale : String @doc(description: "The store locale.") + base_currency_code : String @doc(description: "The base currency code.") + default_display_currency_code : String @doc(description: "The default display currency code.") + timezone : String @doc(description: "The time zone of the store.") + weight_unit : String @doc(description: "The unit of weight.") + base_url : String @doc(description: "The store’s fully-qualified base URL.") + base_link_url : String @doc(description: "A fully-qualified URL that is used to create relative links to the `base_url`.") + base_static_url : String @doc(description: "The fully-qualified URL that specifies the location of static view files.") + base_media_url : String @doc(description: "The fully-qualified URL that specifies the location of media files.") + secure_base_url : String @doc(description: "The store’s fully-qualified secure base URL.") + secure_base_link_url : String @doc(description: "A secure fully-qualified URL that is used to create relative links to the `base_url`.") + secure_base_static_url : String @doc(description: "The secure fully-qualified URL that specifies the location of static view files.") + secure_base_media_url : String @doc(description: "The secure fully-qualified URL that specifies the location of media files.") + use_store_in_url: Boolean @doc(description: "Indicates whether the store code should be used in the URL.") } diff --git a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls index 3491568108daf..e3157b934b6ae 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls @@ -2,20 +2,20 @@ # See COPYING.txt for license details. interface ProductInterface { - swatch_image: String @doc(description: "The file name of a swatch image") + swatch_image: String @doc(description: "The file name of a swatch image.") } input ProductFilterInput { - swatch_image: FilterTypeInput @doc(description: "The file name of a swatch image") + swatch_image: FilterTypeInput @doc(description: "The file name of a swatch image.") } input ProductSortInput { - swatch_image: SortEnum @doc(description: "The file name of a swatch image") + swatch_image: SortEnum @doc(description: "Indicates the criteria to sort swatches.") } interface SwatchLayerFilterItemInterface @typeResolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\SwatchLayerFilterItemResolver") { - swatch_data: SwatchData @doc(description: "Data required to render swatch filter item") + swatch_data: SwatchData @doc(description: "Data required to render a swatch filter item.") } type SwatchLayerFilterItem implements LayerFilterItemInterface, SwatchLayerFilterItemInterface @@ -23,21 +23,21 @@ type SwatchLayerFilterItem implements LayerFilterItemInterface, SwatchLayerFilte } -type SwatchData { - type: String @doc(description: "Type of swatch filter item: 1 - text, 2 - image") - value: String @doc(description: "Value for swatch item (text or image link)") +type SwatchData @doc(description: "Describes the swatch type and a value.") { + type: String @doc(description: "The type of swatch filter item: 1 - text; 2 - image.") + value: String @doc(description: "The value for the swatch item. It could be text or an image link.") } type ConfigurableProductOptionsValues { - swatch_data: SwatchDataInterface @doc(description: "Swatch data for configurable product option") @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") + swatch_data: SwatchDataInterface @doc(description: "Swatch data for a configurable product option.") @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") } interface SwatchDataInterface @typeResolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchDataTypeResolver") { - value: String @doc(description: "Value of swatch item (HEX color code, image link or textual value)") + value: String @doc(description: "The value can be represented as color (HEX code), image link, or text.") } type ImageSwatchData implements SwatchDataInterface { - thumbnail: String @doc(description: "Thumbnail swatch image URL") + thumbnail: String @doc(description: "The URL assigned to the thumbnail of the swatch image.") } type TextSwatchData implements SwatchDataInterface { @@ -49,5 +49,5 @@ type ColorSwatchData implements SwatchDataInterface { } type ConfigurableProductOptionValue { - swatch: SwatchDataInterface @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") + swatch: SwatchDataInterface @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") @doc(description: "The URL assigned to the thumbnail of the swatch image.") } diff --git a/app/code/Magento/TaxGraphQl/etc/schema.graphqls b/app/code/Magento/TaxGraphQl/etc/schema.graphqls index d0be08fe9a1bd..295c8122a1253 100644 --- a/app/code/Magento/TaxGraphQl/etc/schema.graphqls +++ b/app/code/Magento/TaxGraphQl/etc/schema.graphqls @@ -2,5 +2,5 @@ # See COPYING.txt for license details. enum PriceAdjustmentCodesEnum { - TAX @deprecated(reason: "PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog") + TAX @deprecated(reason: "`PriceAdjustmentCodesEnum` is deprecated. Tax is included or excluded in the price. Tax is not shown separately in Catalog.") } diff --git a/app/code/Magento/ThemeGraphQl/etc/schema.graphqls b/app/code/Magento/ThemeGraphQl/etc/schema.graphqls index 325fcc8bd9834..d9fea6b4c4bd9 100644 --- a/app/code/Magento/ThemeGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ThemeGraphQl/etc/schema.graphqls @@ -1,19 +1,19 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type StoreConfig @doc(description: "The type contains information about a store config") { - head_shortcut_icon : String @doc(description: "Favicon Icon") - default_title : String @doc(description: "Default Page Title") - title_prefix : String @doc(description: "Page Title Prefix") - title_suffix : String @doc(description: "Page Title Suffix") - default_description : String @doc(description: "Default Meta Description") - default_keywords : String @doc(description: "Default Meta Keywords") - head_includes : String @doc(description: "Scripts and Style Sheets") - demonotice : Int @doc(description: "Display Demo Store Notice") - header_logo_src : String @doc(description: "Logo Image") - logo_width : Int @doc(description: "Logo Attribute Width") - logo_height : Int @doc(description: "Logo Attribute Height") - welcome : String @doc(description: "Welcome Text") - logo_alt : String @doc(description: "Logo Image Alt") - absolute_footer : String @doc(description: "Footer Miscellaneous HTML") - copyright : String @doc(description: "Copyright") +type StoreConfig { + head_shortcut_icon : String @doc(description: "The small graphic image (favicon) that appears in the address bar and tab of the browser.") + default_title : String @doc(description: "The title that appears at the title bar of each page when viewed in a browser.") + title_prefix : String @doc(description: "A prefix that appears before the title to create a two- or three-part title.") + title_suffix : String @doc(description: "A suffix that appears after the title to create a two- or three-part title.") + default_description : String @doc(description: "The description that provides a summary of your site for search engine listings. It should not be more than 160 characters in length.") + default_keywords : String @doc(description: "A series of keywords that describe your store, each separated by a comma.") + head_includes : String @doc(description: "Scripts that must be included in the HTML before the closing `` tag.") + demonotice : Int @doc(description: "Controls the display of the demo store notice at the top of the page. Options: 0 (No) or 1 (Yes).") + header_logo_src : String @doc(description: "The path to the logo that appears in the header.") + logo_width : Int @doc(description: "The width of the logo image, in pixels.") + logo_height : Int @doc(description: "The height of the logo image, in pixels.") + welcome : String @doc(description: "Text that appears in the header of the page and includes the name of the logged in customer.") + logo_alt : String @doc(description: "The Alt text that is associated with the logo.") + absolute_footer : String @doc(description: "Contains scripts that must be included in the HTML before the closing `` tag.") + copyright : String @doc(description: "The copyright statement that appears at the bottom of each page.") } diff --git a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls index 79e9a1dd5fe5b..46f760c14acbc 100644 --- a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls @@ -2,34 +2,34 @@ # See COPYING.txt for license details. type Query { - urlResolver(url: String!): EntityUrl @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\EntityUrl") @doc(description: "The urlResolver query returns the relative URL for a specified product, category or CMS page, using as input a url_key appended by the url_suffix, if one exists") @deprecated(reason: "Use the 'route' query instead") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") - route(url: String!): RoutableInterface @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\Route") @doc(description: "Return the full details for a specified product, category, or CMS page given the specified url_key, appended by the url_suffix, if one exists") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") + urlResolver(url: String! @doc(description: "A `url_key` appended by the `url_suffix, if one exists.")): EntityUrl @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\EntityUrl") @doc(description: "Return the relative URL for a specified product, category or CMS page.") @deprecated(reason: "Use the `route` query instead.") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") + route(url: String! @doc(description: "A `url_key` appended by the `url_suffix, if one exists.")): RoutableInterface @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\Route") @doc(description: "Return the full details for a specified product, category, or CMS page.") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") } -type EntityUrl @doc(description: "EntityUrl is an output object containing the `id`, `relative_url`, and `type` attributes") { +type EntityUrl @doc(description: "Contains the `uid`, `relative_url`, and `type` attributes.") { id: Int @deprecated(reason: "Use `entity_uid` instead.") @doc(description: "The ID assigned to the object associated with the specified url. This could be a product ID, category ID, or page ID.") - entity_uid: ID @doc(description: "The unique ID for a `ProductInterface`, `CategoryInterface`, `CmsPage`, etc. object associated with the specified url. This could be a product UID, category UID, or cms page UID.") - canonical_url: String @deprecated(reason: "The canonical_url field is deprecated, use relative_url instead.") - relative_url: String @doc(description: "The internal relative URL. If the specified url is a redirect, the query returns the redirected URL, not the original.") - redirectCode: Int @doc(description: "301 or 302 HTTP code for url permanent or temporary redirect or 0 for the 200 no redirect") + entity_uid: ID @doc(description: "The unique ID for a `ProductInterface`, `CategoryInterface`, `CmsPage`, or similar object associated with the specified URL. This could be a product, category, or CMS page UID.") + canonical_url: String @deprecated(reason: "Use `relative_url` instead.") + relative_url: String @doc(description: "The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original.") + redirectCode: Int @doc(description: "Contains 0 when there is no redirect error. A value of 301 indicates the URL of the requested resource has been changed permanently, while a value of 302 indicates a temporary redirect.") type: UrlRewriteEntityTypeEnum @doc(description: "One of PRODUCT, CATEGORY, or CMS_PAGE.") } enum UrlRewriteEntityTypeEnum { } -type UrlRewrite @doc(description: "The object contains URL rewrite details") { - url: String @doc(description: "Request URL") - parameters: [HttpQueryParameter] @doc(description: "Request parameters") +type UrlRewrite @doc(description: "Contains URL rewrite details.") { + url: String @doc(description: "The request URL.") + parameters: [HttpQueryParameter] @doc(description: "An array of request parameters.") } -type HttpQueryParameter @doc(description: "The object details of target path parameters") { - name: String @doc(description: "Parameter name") - value: String @doc(description: "Parameter value") +type HttpQueryParameter @doc(description: "Contains target path parameters.") { + name: String @doc(description: "A parameter name.") + value: String @doc(description: "A parameter value.") } -interface RoutableInterface @typeResolver(class: "Magento\\UrlRewriteGraphQl\\Model\\RoutableInterfaceTypeResolver") @doc(description: "Routable entities serve as the model for a rendered page") { - relative_url: String @doc(description: "The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original") - redirect_code: Int! @doc(description: "Contains 0 when there is no redirect error. A value of 301 indicates the URL of the requested resource has been changed permanently, while a value of 302 indicates a temporary redirect") +interface RoutableInterface @typeResolver(class: "Magento\\UrlRewriteGraphQl\\Model\\RoutableInterfaceTypeResolver") @doc(description: "Routable entities serve as the model for a rendered page.") { + relative_url: String @doc(description: "The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original.") + redirect_code: Int! @doc(description: "Contains 0 when there is no redirect error. A value of 301 indicates the URL of the requested resource has been changed permanently, while a value of 302 indicates a temporary redirect.") type: UrlRewriteEntityTypeEnum @doc(description: "One of PRODUCT, CATEGORY, or CMS_PAGE.") } diff --git a/app/code/Magento/VaultGraphQl/etc/schema.graphqls b/app/code/Magento/VaultGraphQl/etc/schema.graphqls index 64484fe9e814f..172de5a9f7087 100644 --- a/app/code/Magento/VaultGraphQl/etc/schema.graphqls +++ b/app/code/Magento/VaultGraphQl/etc/schema.graphqls @@ -2,30 +2,33 @@ # See COPYING.txt for license details. type Mutation { - deletePaymentToken(public_hash: String!): DeletePaymentTokenOutput @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\DeletePaymentToken") @doc(description:"Delete a customer payment token") + """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" + deletePaymentToken(public_hash: String! @doc(description: "The reusable payment token securely stored in the vault.")): DeletePaymentTokenOutput @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\DeletePaymentToken") @doc(description:"Delete a customer's payment token.") } -type DeletePaymentTokenOutput { - result: Boolean! - customerPaymentTokens: CustomerPaymentTokens @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\PaymentTokens") +type DeletePaymentTokenOutput @doc(description: "Indicates whether the request succeeded and returns the remaining customer payment tokens.") { + result: Boolean! @doc(description: "Indicates whether the request succeeded.") + customerPaymentTokens: CustomerPaymentTokens @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\PaymentTokens") @doc(description: "A container for the customer's remaining payment tokens.") } type Query { - customerPaymentTokens: CustomerPaymentTokens @doc(description: "Return a list of customer payment tokens") @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\PaymentTokens") @cache(cacheable: false) + customerPaymentTokens: CustomerPaymentTokens @doc(description: "Return a list of customer payment tokens stored in the vault.") @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\PaymentTokens") @cache(cacheable: false) } -type CustomerPaymentTokens @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\PaymentTokens") { - items: [PaymentToken]! @doc(description: "An array of payment tokens") +type CustomerPaymentTokens @resolver(class: "\\Magento\\VaultGraphQl\\Model\\Resolver\\PaymentTokens") @doc(description: "Contains payment tokens stored in the customer's vault.") { + items: [PaymentToken]! @doc(description: "An array of payment tokens.") } -type PaymentToken @doc(description: "The stored payment method available to the customer") { - public_hash: String! @doc(description: "The public hash of the token") - payment_method_code: String! @doc(description: "The payment method code associated with the token") - type: PaymentTokenTypeEnum! - details: String @doc(description: "Stored account details") +type PaymentToken @doc(description: "The stored payment method available to the customer.") { + public_hash: String! @doc(description: "The public hash of the token.") + payment_method_code: String! @doc(description: "The payment method code associated with the token.") + type: PaymentTokenTypeEnum! @doc(description: "Specifies the payment token type.") + details: String @doc(description: "A description of the stored account details.") } -enum PaymentTokenTypeEnum @doc(description: "The list of available payment token types") { +enum PaymentTokenTypeEnum @doc(description: "The list of available payment token types.") { + """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" card + """phpcs:ignore Magento2.GraphQL.ValidArgumentName""" account } diff --git a/app/code/Magento/WeeeGraphQl/etc/schema.graphqls b/app/code/Magento/WeeeGraphQl/etc/schema.graphqls index 6d212f25618e2..6e819b49f75ff 100644 --- a/app/code/Magento/WeeeGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WeeeGraphQl/etc/schema.graphqls @@ -2,33 +2,33 @@ # See COPYING.txt for license details. enum PriceAdjustmentCodesEnum { - WEEE @deprecated(reason: "WEEE code is deprecated, use fixed_product_taxes.label") - WEEE_TAX @deprecated(reason: "Use fixed_product_taxes. PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog") + WEEE @deprecated(reason: "WEEE code is deprecated. Use `fixed_product_taxes.label` instead.") + WEEE_TAX @deprecated(reason: "Use `fixed_product_taxes` instead. Tax is included or excluded in price. The tax is not shown separtely in Catalog.") } type ProductPrice { - fixed_product_taxes: [FixedProductTax] @doc(description: "The multiple FPTs that can be applied to a product price.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\FixedProductTax") + fixed_product_taxes: [FixedProductTax] @doc(description: "An array of the multiple Fixed Product Taxes that can be applied to a product price.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\FixedProductTax") } type CartItemPrices { - fixed_product_taxes: [FixedProductTax] @doc(description: "Applied FPT to the cart item.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\Quote\\FixedProductTax") + fixed_product_taxes: [FixedProductTax] @doc(description: "An array of FPTs applied to the cart item.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\Quote\\FixedProductTax") } type FixedProductTax @doc(description: "A single FPT that can be applied to a product price.") { - amount: Money @doc(description: "Amount of the FPT as a money object.") - label: String @doc(description: "The label assigned to the FPT to be displayed on the frontend.") + amount: Money @doc(description: "The amount of the Fixed Product Tax.") + label: String @doc(description: "The display label assigned to the Fixed Product Tax.") } type StoreConfig { - product_fixed_product_tax_display_setting : FixedProductTaxDisplaySettings @doc(description: "Corresponds to the 'Display Prices On Product View Page' field. It indicates how FPT information is displayed on product pages") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\StoreConfig") - category_fixed_product_tax_display_setting : FixedProductTaxDisplaySettings @doc(description: "Corresponds to the 'Display Prices In Product Lists' field. It indicates how FPT information is displayed on category pages") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\StoreConfig") - sales_fixed_product_tax_display_setting : FixedProductTaxDisplaySettings @doc(description: "Corresponds to the 'Display Prices In Sales Modules' field. It indicates how FPT information is displayed on cart, checkout, and order pages") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\StoreConfig") + product_fixed_product_tax_display_setting : FixedProductTaxDisplaySettings @doc(description: "Corresponds to the 'Display Prices On Product View Page' field in the Admin. It indicates how FPT information is displayed on product pages.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\StoreConfig") + category_fixed_product_tax_display_setting : FixedProductTaxDisplaySettings @doc(description: "Corresponds to the 'Display Prices In Product Lists' field in the Admin. It indicates how FPT information is displayed on category pages.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\StoreConfig") + sales_fixed_product_tax_display_setting : FixedProductTaxDisplaySettings @doc(description: "Corresponds to the 'Display Prices In Sales Modules' field in the Admin. It indicates how FPT information is displayed on cart, checkout, and order pages.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\StoreConfig") } -enum FixedProductTaxDisplaySettings @doc(description: "This enumeration display settings for the fixed product tax") { - INCLUDE_FPT_WITHOUT_DETAILS @doc(description: "The displayed price includes the FPT amount without displaying the ProductPrice.fixed_product_taxes values. This value corresponds to 'Including FPT only'") - INCLUDE_FPT_WITH_DETAILS @doc(description: "The displayed price includes the FPT amount while displaying the values of ProductPrice.fixed_product_taxes separately. This value corresponds to 'Including FPT and FPT description'") - EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS @doc(description: "The displayed price does not include the FPT amount. The values of ProductPrice.fixed_product_taxes and the price including the FPT are displayed separately. This value corresponds to 'Excluding FPT, Including FPT description and final price'") - EXCLUDE_FPT_WITHOUT_DETAILS @doc(description: "The displayed price does not include the FPT amount. The values from ProductPrice.fixed_product_taxes are not displayed. This value corresponds to 'Excluding FPT'") - FPT_DISABLED @doc(description: "The FPT feature is not enabled. You can omit ProductPrice.fixed_product_taxes from your query") +enum FixedProductTaxDisplaySettings @doc(description: "Lists display settings for the Fixed Product Tax.") { + INCLUDE_FPT_WITHOUT_DETAILS @doc(description: "The displayed price includes the FPT amount without displaying the `ProductPrice.fixed_product_taxes` values. This value corresponds to 'Including FPT only'.") + INCLUDE_FPT_WITH_DETAILS @doc(description: "The displayed price includes the FPT amount while displaying the values of `ProductPrice.fixed_product_taxes` separately. This value corresponds to 'Including FPT and FPT description'.") + EXCLUDE_FPT_AND_INCLUDE_WITH_DETAILS @doc(description: "The displayed price does not include the FPT amount. The values of `ProductPrice.fixed_product_taxes` and the price including the FPT are displayed separately. This value corresponds to 'Excluding FPT, Including FPT description and final price.'") + EXCLUDE_FPT_WITHOUT_DETAILS @doc(description: "The displayed price does not include the FPT amount. The values from `ProductPrice.fixed_product_taxes` are not displayed. This value corresponds to 'Excluding FPT'.") + FPT_DISABLED @doc(description: "The FPT feature is not enabled. You can omit `ProductPrice.fixed_product_taxes` from your query.") } diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index ab5ccbd2e18c3..bdc0acda47387 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -2,131 +2,131 @@ # See COPYING.txt for license details. type Query { - wishlist: WishlistOutput @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistResolver") @deprecated(reason: "Moved under `Customer` `wishlist`") @doc(description: "The wishlist query returns the contents of a customer's wish list") @cache(cacheable: false) + wishlist: WishlistOutput @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistResolver") @deprecated(reason: "Moved under `Customer.wishlist`.") @doc(description: "Return the contents of a customer's wish list.") @cache(cacheable: false) } type Customer { wishlists( pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. This attribute is optional."), currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1.") - ): [Wishlist!]! @doc(description: "An array of wishlists. In Magento Open Source, customers are limited to one wish list. The number of wish lists is configurable for Magento Commerce") @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlists") - wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2`") @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlistResolver") @doc(description: "Contains a customer's wish lists") @cache(cacheable: false) - wishlist_v2(id: ID!): Wishlist @doc(description: "Retrieve the specified wish list identified by the unique ID for a `Wishlist` object") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistById") + ): [Wishlist!]! @doc(description: "An array of wishlists. In Magento Open Source, customers are limited to one wish list. The number of wish lists is configurable for Adobe Commerce.") @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlists") + wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2` instead.") @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlistResolver") @doc(description: "Return a customer's wish lists.") @cache(cacheable: false) + wishlist_v2(id: ID!): Wishlist @doc(description: "Retrieve the wish list identified by the unique ID for a `Wishlist` object.") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistById") } -type WishlistOutput @doc(description: "Deprecated: `Wishlist` type should be used instead") { - items: [WishlistItem] @deprecated(reason: "Use field `items` from type `Wishlist` instead") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @doc(description: "An array of items in the customer's wish list"), - items_count: Int @deprecated(reason: "Use field `items_count` from type `Wishlist` instead") @doc(description: "The number of items in the wish list"), - name: String @deprecated(reason: "This field is related to Commerce functionality and is always `null` in Open Source edition") @doc(description: "When multiple wish lists are enabled, the name the customer assigns to the wishlist"), - sharing_code: String @deprecated(reason: "Use field `sharing_code` from type `Wishlist` instead") @doc(description: "An encrypted code that Magento uses to link to the wish list"), - updated_at: String @deprecated(reason: "Use field `updated_at` from type `Wishlist` instead") @doc(description: "The time of the last modification to the wish list") +type WishlistOutput @doc(description: "Deprecated: Use the `Wishlist` type instead.") { + items: [WishlistItem] @deprecated(reason: "Use the `Wishlist.items` field instead.") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @doc(description: "An array of items in the customer's wish list"), + items_count: Int @deprecated(reason: "Use the `Wishlist.items_count` field instead.") @doc(description: "The number of items in the wish list."), + name: String @deprecated(reason: "This field is related to Commerce functionality and is always `null` in Open Source.") @doc(description: "When multiple wish lists are enabled, the name the customer assigns to the wishlist."), + sharing_code: String @deprecated(reason: "Use the `Wishlist.sharing_code` field instead.") @doc(description: "An encrypted code that links to the wish list."), + updated_at: String @deprecated(reason: "Use the `Wishlist.updated_at` field instead.") @doc(description: "The time of the last modification to the wish list.") } -type Wishlist { - id: ID @doc(description: "The unique ID for a `Wishlist` object") - items: [WishlistItem] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead") +type Wishlist @doc(description: "Contains a customer wish list.") { + id: ID @doc(description: "The unique ID for a `Wishlist` object.") + items: [WishlistItem] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @deprecated(reason: "Use the `items_v2` field instead.") items_v2( currentPage: Int = 1, pageSize: Int = 20 - ): WishlistItems @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItems") @doc(description: "An array of items in the customer's wish list") - items_count: Int @doc(description: "The number of items in the wish list") - sharing_code: String @doc(description: "An encrypted code that Magento uses to link to the wish list") - updated_at: String @doc(description: "The time of the last modification to the wish list") + ): WishlistItems @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItems") @doc(description: "An array of items in the customer's wish list.") + items_count: Int @doc(description: "The number of items in the wish list.") + sharing_code: String @doc(description: "An encrypted code that Magento uses to link to the wish list.") + updated_at: String @doc(description: "The time of the last modification to the wish list.") } -interface WishlistItemInterface @typeResolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Type\\WishlistItemType") { - id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object") - quantity: Float! @doc(description: "The quantity of this wish list item") - description: String @doc(description: "The description of the item") - added_at: String! @doc(description: "The date and time the item was added to the wish list") - product: ProductInterface @doc(description: "Product details of the wish list item") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver") - customizable_options: [SelectedCustomizableOption]! @doc(description: "Custom options selected for the wish list item") +interface WishlistItemInterface @typeResolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Type\\WishlistItemType") @doc(description: "The interface for wish list items."){ + id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object.") + quantity: Float! @doc(description: "The quantity of this wish list item.") + description: String @doc(description: "The description of the item.") + added_at: String! @doc(description: "The date and time the item was added to the wish list.") + product: ProductInterface @doc(description: "Product details of the wish list item.") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver") + customizable_options: [SelectedCustomizableOption]! @doc(description: "Custom options selected for the wish list item.") } -type WishlistItems { - items: [WishlistItemInterface]! @doc(description: "A list of items in the wish list") - page_info: SearchResultPageInfo @doc(description: "Contains pagination metadata") +type WishlistItems @doc(description: "Contains an array of items in a wish list.") { + items: [WishlistItemInterface]! @doc(description: "A list of items in the wish list.") + page_info: SearchResultPageInfo @doc(description: "Contains pagination metadata.") } -type WishlistItem { - id: Int @doc(description: "The unique ID for a `WishlistItem` object") +type WishlistItem @doc(description: "Contains details about a wish list item.") { + id: Int @doc(description: "The unique ID for a `WishlistItem` object.") qty: Float @doc(description: "The quantity of this wish list item"), - description: String @doc(description: "The customer's comment about this item"), - added_at: String @doc(description: "The time when the customer added the item to the wish list"), - product: ProductInterface @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver") + description: String @doc(description: "The customer's comment about this item."), + added_at: String @doc(description: "The time when the customer added the item to the wish list."), + product: ProductInterface @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver") @doc(description: "Details about the wish list item.") } type Mutation { - addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput @doc(description: "Adds one or more products to the specified wish list. This mutation supports all product types") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\AddProductsToWishlist") - removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput @doc(description: "Removes one or more products from the specified wish list") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\RemoveProductsFromWishlist") - updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput @doc(description: "Updates one or more products in the specified wish list") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\UpdateProductsInWishlist") + addProductsToWishlist(wishlistId: ID! @doc(description: "The ID of a wish list."), wishlistItems: [WishlistItemInput!]! @doc(description: "An array of products to add to the wish list.")): AddProductsToWishlistOutput @doc(description: "Add one or more products to the specified wish list. This mutation supports all product types.") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\AddProductsToWishlist") + removeProductsFromWishlist(wishlistId: ID! @doc(description: "The ID of a wish list."), wishlistItemsIds: [ID!]! @doc(description: "An array of item IDs representing products to be removed.")): RemoveProductsFromWishlistOutput @doc(description: "Remove one or more products from the specified wish list.") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\RemoveProductsFromWishlist") + updateProductsInWishlist(wishlistId: ID! @doc(description: "The ID of a wish list."), wishlistItems: [WishlistItemUpdateInput!]! @doc(description: "An array of items to be updated.")): UpdateProductsInWishlistOutput @doc(description: "Update one or more products in the specified wish list.") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\UpdateProductsInWishlist") addWishlistItemsToCart( wishlistId: ID!, @doc(description: "The unique ID of the wish list") wishlistItemIds: [ID!] @doc(description: "An array of IDs representing products to be added to the cart. If no IDs are specified, all items in the wishlist will be added to the cart") - ): AddWishlistItemsToCartOutput @resolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Wishlist\\AddToCart") @doc(description: "Add items in the specified wishlist to the customer's cart") + ): AddWishlistItemsToCartOutput @resolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Wishlist\\AddToCart") @doc(description: "Add items in the specified wishlist to the customer's cart.") } -type AddWishlistItemsToCartOutput { - wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully added") - status: Boolean! @doc(description: "Indicates whether the attempt to add items to the customer's cart was successful") - add_wishlist_items_to_cart_user_errors: [WishlistCartUserInputError!]! @doc(description: "An array of errors encountered while adding products to the customer's cart") +type AddWishlistItemsToCartOutput @doc(description: "Contains the resultant wish list and any error information.") { + wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully added.") + status: Boolean! @doc(description: "Indicates whether the attempt to add items to the customer's cart was successful.") + add_wishlist_items_to_cart_user_errors: [WishlistCartUserInputError!]! @doc(description: "An array of errors encountered while adding products to the customer's cart.") } -type WishlistCartUserInputError { - message: String! @doc(description: "A localized error message") - code: WishlistCartUserInputErrorType! @doc(description: "An error code that describes the error encountered") - wishlistId: ID! @doc(description: "The unique ID of the `Wishlist` object containing an error") - wishlistItemId: ID! @doc(description: "The unique ID of the wish list item containing an error") +type WishlistCartUserInputError @doc(description: "Contains details about errors encountered when a customer added wish list items to the cart.") { + message: String! @doc(description: "A localized error message.") + code: WishlistCartUserInputErrorType! @doc(description: "An error code that describes the error encountered.") + wishlistId: ID! @doc(description: "The unique ID of the `Wishlist` object containing an error.") + wishlistItemId: ID! @doc(description: "The unique ID of the wish list item containing an error.") } -enum WishlistCartUserInputErrorType { +enum WishlistCartUserInputErrorType @doc(description: "A list of possible error types.") { PRODUCT_NOT_FOUND NOT_SALABLE INSUFFICIENT_STOCK UNDEFINED } -input WishlistItemInput @doc(description: "Defines the items to add to a wish list") { - sku: String! @doc(description: "The SKU of the product to add. For complex product types, specify the child product SKU") - quantity: Float! @doc(description: "The amount or number of items to add") - parent_sku: String @doc(description: "For complex product types, the SKU of the parent product") - selected_options: [ID!] @doc(description: "An array of strings corresponding to options the customer selected") - entered_options: [EnteredOptionInput!] @doc(description: "An array of options that the customer entered") +input WishlistItemInput @doc(description: "Defines the items to add to a wish list.") { + sku: String! @doc(description: "The SKU of the product to add. For complex product types, specify the child product SKU.") + quantity: Float! @doc(description: "The amount or number of items to add.") + parent_sku: String @doc(description: "For complex product types, the SKU of the parent product.") + selected_options: [ID!] @doc(description: "An array of strings corresponding to options the customer selected.") + entered_options: [EnteredOptionInput!] @doc(description: "An array of options that the customer entered.") } -type AddProductsToWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered") { - wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully added") - user_errors:[WishListUserInputError!]! @doc(description: "An array of errors encountered while adding products to a wish list") +type AddProductsToWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered.") { + wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully added.") + user_errors:[WishListUserInputError!]! @doc(description: "An array of errors encountered while adding products to a wish list.") } -type RemoveProductsFromWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered") { - wishlist: Wishlist! @doc(description: "Contains the wish list with after items were successfully deleted") - user_errors:[WishListUserInputError!]! @doc(description:"An array of errors encountered while deleting products from a wish list") +type RemoveProductsFromWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered.") { + wishlist: Wishlist! @doc(description: "Contains the wish list with after items were successfully deleted.") + user_errors:[WishListUserInputError!]! @doc(description:"An array of errors encountered while deleting products from a wish list.") } -input WishlistItemUpdateInput @doc(description: "Defines updates to items in a wish list") { - wishlist_item_id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object") - quantity: Float @doc(description: "The new amount or number of this item") - description: String @doc(description: "Customer-entered comments about the item") - selected_options: [ID!] @doc(description: "An array of strings corresponding to options the customer selected") - entered_options: [EnteredOptionInput!] @doc(description: "An array of options that the customer entered") +input WishlistItemUpdateInput @doc(description: "Defines updates to items in a wish list.") { + wishlist_item_id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object.") + quantity: Float @doc(description: "The new amount or number of this item.") + description: String @doc(description: "Customer-entered comments about the item.") + selected_options: [ID!] @doc(description: "An array of strings corresponding to options the customer selected.") + entered_options: [EnteredOptionInput!] @doc(description: "An array of options that the customer entered.") } -type UpdateProductsInWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered") { - wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully updated") - user_errors: [WishListUserInputError!]! @doc(description:"An array of errors encountered while updating products in a wish list") +type UpdateProductsInWishlistOutput @doc(description: "Contains the customer's wish list and any errors encountered.") { + wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully updated.") + user_errors: [WishListUserInputError!]! @doc(description:"An array of errors encountered while updating products in a wish list.") } type WishListUserInputError @doc(description:"An error encountered while performing operations with WishList.") { - message: String! @doc(description: "A localized error message") - code: WishListUserInputErrorType! @doc(description: "Wishlist-specific error code") + message: String! @doc(description: "A localized error message.") + code: WishListUserInputErrorType! @doc(description: "A wish list-specific error code.") } -enum WishListUserInputErrorType { +enum WishListUserInputErrorType @doc(description: "A list of possible error types.") { PRODUCT_NOT_FOUND UNDEFINED } type StoreConfig { - magento_wishlist_general_is_enabled: String @doc(description: "Indicates whether wishlists are enabled (1) or disabled (0)") + magento_wishlist_general_is_enabled: String @doc(description: "Indicates whether wishlists are enabled (1) or disabled (0).") } diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_products.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_products.php new file mode 100644 index 0000000000000..00e7c35c44a80 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_products.php @@ -0,0 +1,32 @@ +requireDataFixture('Magento/Catalog/_files/multiple_products.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager() + ->create(ProductRepositoryInterface::class); +/** @var CartRepositoryInterface $quoteRepository */ +$quoteRepository = $objectManager->get(CartRepositoryInterface::class); +/** @var CartInterface $quote */ +$quote = $objectManager->get(CartInterfaceFactory::class)->create(); +$quote->setIsActive(true) + ->setStoreId(1) + ->setCheckoutMethod(Onepage::METHOD_GUEST) + ->setReservedOrderId('test_quote_with_simple_products'); +$quote->addProduct($productRepository->get('simple1'), 1); +$quote->addProduct($productRepository->get('simple2'), 1); +$quoteRepository->save($quote); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_products_rollback.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_products_rollback.php new file mode 100644 index 0000000000000..b47beadb76ff1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_products_rollback.php @@ -0,0 +1,28 @@ +get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var $order Quote */ +$quoteCollection = Bootstrap::getObjectManager()->create(Collection::class); +foreach ($quoteCollection as $quote) { + $quote->delete(); +} + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/multiple_products_rollback.php'); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php index 7ddb38ac94e5d..39b67e5c60214 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php @@ -427,7 +427,7 @@ public function testMultishipping( public function multishippingDataProvider(): array { return [ - 'Discount < 1stOrderSubtotal: only 1st order gets discount' => [ + 'Discount $5 proportionally spread between products' => [ 5, [ 'subtotal' => 10.00, @@ -443,54 +443,12 @@ public function multishippingDataProvider(): array ], [ 'subtotal' => 5.00, - 'discount_amount' => -5.00, - 'shipping_amount' => 0.00, - 'grand_total' => 0.00, - ] - ], - 'Discount = 1stOrderSubtotal: only 1st order gets discount' => [ - 10, - [ - 'subtotal' => 10.00, - 'discount_amount' => -2.8600, - 'shipping_amount' => 5.00, - 'grand_total' => 12.1400, - ], - [ - 'subtotal' => 20.00, - 'discount_amount' => -5.71, - 'shipping_amount' => 5.00, - 'grand_total' => 19.2900, - ], - [ - 'subtotal' => 5.00, - 'discount_amount' => -5.00, + 'discount_amount' => -0.71, 'shipping_amount' => 0.00, - 'grand_total' => 0.00, + 'grand_total' => 4.2900, ] ], - 'Discount > 1stOrderSubtotal: 1st order get 100% discount and 2nd order get the remaining discount' => [ - 15, - [ - 'subtotal' => 10.00, - 'discount_amount' => -4.2900, - 'shipping_amount' => 5.00, - 'grand_total' => 10.71, - ], - [ - 'subtotal' => 20.00, - 'discount_amount' => -8.5700, - 'shipping_amount' => 5.00, - 'grand_total' => 16.43, - ], - [ - 'subtotal' => 5.00, - 'discount_amount' => -5.00, - 'shipping_amount' => 0.00, - 'grand_total' => 0.00, - ] - ], - 'Discount = 1stOrderSubtotal + 2ndOrderSubtotal: 1st order and 2nd order get 100% discount' => [ + 'Discount $30 proportionally spread between products' => [ 30, [ 'subtotal' => 10.00, @@ -506,36 +464,67 @@ public function multishippingDataProvider(): array ], [ 'subtotal' => 5.00, - 'discount_amount' => -5.00, + 'discount_amount' => -4.29, 'shipping_amount' => 0.00, - 'grand_total' => 0.00, + 'grand_total' => 0.7100, ] ], - 'Discount > 1stOrdSubtotal + 2ndOrdSubtotal: 1st order and 2nd order get 100% discount' - . ' and 3rd order get remaining discount' => [ - 31, + 'Discount $50 which is more then all subtotals combined proportionally spread between products' => [ + 50, [ 'subtotal' => 10.00, - 'discount_amount' => -8.8600, + 'discount_amount' => -10.0000, 'shipping_amount' => 5.00, - 'grand_total' => 6.14, + 'grand_total' => 5.0000, ], [ 'subtotal' => 20.00, - 'discount_amount' => -17.7100, + 'discount_amount' => -20.0000, 'shipping_amount' => 5.00, - 'grand_total' => 7.29, + 'grand_total' => 5.0000, ], [ 'subtotal' => 5.00, 'discount_amount' => -5.00, 'shipping_amount' => 0.00, - 'grand_total' => 0.00, + 'grand_total' => 0.0000, ] - ] + ], ]; } + /** + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/SalesRule/_files/cart_rule_50_percent_off_no_condition.php + * @magentoDataFixture Magento/SalesRule/_files/cart_fixed_10_discount.php + * @magentoDataFixture Magento/Checkout/_files/quote_with_simple_products.php + * @return void + */ + public function testDiscountsWhenByPercentRuleAppliedFirstAndCartFixedRuleSecond(): void + { + $totalDiscount = -20.99; + $discounts = [ + 'simple1' => 5.72, + 'simple2' => 15.27, + ]; + $quote = $this->getQuote('test_quote_with_simple_products'); + $quote->setCouponCode('2?ds5!2d'); + $quote->collectTotals(); + $this->quoteRepository->save($quote); + $this->assertEquals(21.98, $quote->getBaseSubtotal()); + $this->assertEquals($totalDiscount, $quote->getShippingAddress()->getDiscountAmount()); + $items = $quote->getAllItems(); + $this->assertCount(2, $items); + $item = array_shift($items); + $this->assertEquals('simple1', $item->getSku()); + $this->assertEquals(5.99, $item->getPrice()); + $this->assertEquals($discounts[$item->getSku()], $item->getDiscountAmount()); + $item = array_shift($items); + $this->assertEquals('simple2', $item->getSku()); + $this->assertEquals(15.99, $item->getPrice()); + $this->assertEquals($discounts[$item->getSku()], $item->getDiscountAmount()); + } + /** * Get list of orders by quote id. * diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_fixed_10_discount.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_fixed_10_discount.php new file mode 100644 index 0000000000000..cc69733b37c16 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_fixed_10_discount.php @@ -0,0 +1,38 @@ +create(Rule::class); +$salesRule->setData( + [ + 'name' => '10$ fixed discount on whole cart', + 'is_active' => 1, + 'customer_group_ids' => [GroupManagement::NOT_LOGGED_IN_ID], + 'coupon_type' => Rule::COUPON_TYPE_NO_COUPON, + 'conditions' => [], + 'simple_action' => Rule::CART_FIXED_ACTION, + 'discount_amount' => 10, + 'discount_step' => 10, + 'stop_rules_processing' => 0, + 'website_ids' => [ + $objectManager->get(StoreManagerInterface::class)->getWebsite()->getId(), + ], + 'store_labels' => [ + 'store_id' => 0, + 'store_label' => '10$ fixed discount on whole cart', + ] + ] +); +$objectManager->get(RuleResourceModel::class)->save($salesRule); diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_fixed_10_discount_rollback.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_fixed_10_discount_rollback.php new file mode 100644 index 0000000000000..431104c993458 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_fixed_10_discount_rollback.php @@ -0,0 +1,36 @@ +get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var SearchCriteriaBuilder $searchCriteriaBuilder */ +$searchCriteriaBuilder = $objectManager->get(SearchCriteriaBuilder::class); +$searchCriteria = $searchCriteriaBuilder->addFilter('name', '10$ fixed discount on whole cart') + ->create(); +/** @var RuleRepositoryInterface $ruleRepository */ +$ruleRepository = $objectManager->get(RuleRepositoryInterface::class); +$items = $ruleRepository->getList($searchCriteria) + ->getItems(); +/** @var Rule $salesRule */ +$salesRule = array_pop($items); +if ($salesRule !== null) { + $ruleRepository->deleteById($salesRule->getRuleId()); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_no_condition.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_no_condition.php index 77178abdb2384..de6dff7194ac3 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_no_condition.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_no_condition.php @@ -24,7 +24,7 @@ 'simple_action' => 'by_percent', 'discount_amount' => 50, 'discount_step' => 0, - 'stop_rules_processing' => 1, + 'stop_rules_processing' => 0, 'website_ids' => [ \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( \Magento\Store\Model\StoreManagerInterface::class