Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

251 řádky
17 KiB

  1. # Copyright © Magento, Inc. All rights reserved.
  2. # See COPYING.txt for license details.
  3. type Query {
  4. customerOrders: CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Orders") @deprecated(reason: "Use the `customer` query instead.") @cache(cacheable: false)
  5. }
  6. type Mutation {
  7. 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")
  8. }
  9. type ReorderItemsOutput @doc(description:"Contains the cart and any errors after adding products.") {
  10. cart: Cart! @doc(description:"Detailed information about the customer's cart.")
  11. userInputErrors:[CheckoutUserInputError]! @doc(description:"An array of reordering errors.")
  12. }
  13. type CheckoutUserInputError @doc(description:"An error encountered while adding an item to the cart."){
  14. message: String! @doc(description: "A localized error message.")
  15. 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")
  16. code: CheckoutUserInputErrorCodes! @doc(description: "An error code that is specific to Checkout.")
  17. }
  18. type Customer {
  19. orders (
  20. filter: CustomerOrdersFilterInput @doc(description: "Defines the filter to use for searching customer orders."),
  21. currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."),
  22. pageSize: Int = 20 @doc(description: "Specifies the maximum number of results to return at once. The default value is 20."),
  23. ): CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CustomerOrders") @cache(cacheable: false)
  24. }
  25. input CustomerOrdersFilterInput @doc(description: "Identifies the filter to use for filtering orders.") {
  26. number: FilterStringTypeInput @doc(description: "Filters by order number.")
  27. }
  28. type CustomerOrders @doc(description: "The collection of orders that match the conditions defined in the filter.") {
  29. items: [CustomerOrder]! @doc(description: "An array of customer orders.")
  30. page_info: SearchResultPageInfo @doc(description: "Contains pagination metadata.")
  31. total_count: Int @doc(description: "The total count of customer orders.")
  32. }
  33. type CustomerOrder @doc(description: "Contains details about each of the customer's orders.") {
  34. id: ID! @doc(description: "The unique ID for a `CustomerOrder` object.")
  35. order_date: String! @doc(description: "The date the order was placed.")
  36. status: String! @doc(description: "The current status of the order.")
  37. number: String! @doc(description: "The order number.")
  38. items: [OrderItemInterface] @doc(description: "An array containing the items purchased in this order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItems")
  39. total: OrderTotal @doc(description: "Details about the calculated totals for this order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderTotal")
  40. invoices: [Invoice]! @doc(description: "A list of invoices for the order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoices")
  41. shipments: [OrderShipment] @doc(description: "A list of shipments for the order.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipments")
  42. credit_memos: [CreditMemo] @doc(description: "A list of credit memos.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemos")
  43. payment_methods: [OrderPaymentMethod] @doc(description: "Payment details for the order.")
  44. shipping_address: OrderAddress @doc(description: "The shipping address for the order.")
  45. billing_address: OrderAddress @doc(description: "The billing address for the order.")
  46. carrier: String @doc(description: "The shipping carrier for the order delivery.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CustomerOrders\\Carrier")
  47. shipping_method: String @doc(description: "The delivery method for the order.")
  48. comments: [SalesCommentItem] @doc(description: "Comments about the order.")
  49. increment_id: String @deprecated(reason: "Use the `id` field instead.")
  50. order_number: String! @deprecated(reason: "Use the `number` field instead.")
  51. created_at: String @deprecated(reason: "Use the `order_date` field instead.")
  52. grand_total: Float @deprecated(reason: "Use the `totals.grand_total` field instead.")
  53. }
  54. type OrderAddress @doc(description: "Contains detailed information about an order's billing and shipping addresses."){
  55. firstname: String! @doc(description: "The first name of the person associated with the shipping/billing address.")
  56. lastname: String! @doc(description: "The family name of the person associated with the shipping/billing address.")
  57. middlename: String @doc(description: "The middle name of the person associated with the shipping/billing address.")
  58. region: String @doc(description: "The state or province name.")
  59. region_id: ID @doc(description: "The unique ID for a `Region` object of a pre-defined region.")
  60. country_code: CountryCodeEnum @doc(description: "The customer's country.")
  61. street: [String!]! @doc(description: "An array of strings that define the street number and name.")
  62. company: String @doc(description: "The customer's company.")
  63. telephone: String @doc(description: "The telephone number.")
  64. fax: String @doc(description: "The fax number.")
  65. postcode: String @doc(description: "The customer's ZIP or postal code.")
  66. city: String! @doc(description: "The city or town.")
  67. prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
  68. suffix: String @doc(description: "A value such as Sr., Jr., or III.")
  69. vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers).")
  70. }
  71. interface OrderItemInterface @doc(description: "Order item details.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\OrderItem") {
  72. id: ID! @doc(description: "The unique ID for an `OrderItemInterface` object.")
  73. product_name: String @doc(description: "The name of the base product.")
  74. product_sku: String! @doc(description: "The SKU of the base product.")
  75. product_url_key: String @doc(description: "URL key of the base product.")
  76. product_type: String @doc(description: "The type of product, such as simple, configurable, etc.")
  77. status: String @doc(description: "The status of the order item.")
  78. product_sale_price: Money! @doc(description: "The sale price of the base product, including selected options.")
  79. discounts: [Discount] @doc(description: "The final discount information for the product.")
  80. selected_options: [OrderItemOption] @doc(description: "The selected options for the base product, such as color or size.")
  81. entered_options: [OrderItemOption] @doc(description: "The entered option for the base product, such as a logo or image.")
  82. quantity_ordered: Float @doc(description: "The number of units ordered for this item.")
  83. quantity_shipped: Float @doc(description: "The number of shipped items.")
  84. quantity_refunded: Float @doc(description: "The number of refunded items.")
  85. quantity_invoiced: Float @doc(description: "The number of invoiced items.")
  86. quantity_canceled: Float @doc(description: "The number of canceled items.")
  87. quantity_returned: Float @doc(description: "The number of returned items.")
  88. }
  89. type OrderItem implements OrderItemInterface {
  90. }
  91. type OrderItemOption @doc(description: "Represents order item options like selected or entered.") {
  92. label: String! @doc(description: "The name of the option.")
  93. value: String! @doc(description: "The value of the option.")
  94. }
  95. type TaxItem @doc(description: "Contains tax item details.") {
  96. amount: Money! @doc(description: "The amount of tax applied to the item.")
  97. title: String! @doc(description: "A title that describes the tax.")
  98. rate: Float! @doc(description: "The rate used to calculate the tax.")
  99. }
  100. type OrderTotal @doc(description: "Contains details about the sales total amounts used to calculate the final price.") {
  101. subtotal: Money! @doc(description: "The subtotal of the order, excluding shipping, discounts, and taxes.")
  102. discounts: [Discount] @doc(description: "The applied discounts to the order.")
  103. total_tax: Money! @doc(description: "The amount of tax applied to the order.")
  104. taxes: [TaxItem] @doc(description: "The order tax details.")
  105. grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes.")
  106. base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency.")
  107. total_shipping: Money! @doc(description: "The shipping amount for the order.")
  108. shipping_handling: ShippingHandling @doc(description: "Details about the shipping and handling costs for the order.")
  109. }
  110. type Invoice @doc(description: "Contains invoice details.") {
  111. id: ID! @doc(description: "The unique ID for a `Invoice` object.")
  112. number: String! @doc(description: "Sequential invoice number.")
  113. total: InvoiceTotal @doc(description: "Invoice total amount details.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceTotal")
  114. items: [InvoiceItemInterface] @doc(description: "Invoiced product details.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Invoice\\InvoiceItems")
  115. comments: [SalesCommentItem] @doc(description: "Comments on the invoice.")
  116. }
  117. interface InvoiceItemInterface @doc(description: "Contains detailes about invoiced items.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\InvoiceItem") {
  118. id: ID! @doc(description: "The unique ID for an `InvoiceItemInterface` object.")
  119. order_item: OrderItemInterface @doc(description: "Details about an individual order item.")
  120. product_name: String @doc(description: "The name of the base product.")
  121. product_sku: String! @doc(description: "The SKU of the base product.")
  122. product_sale_price: Money! @doc(description: "The sale price for the base product including selected options.")
  123. discounts: [Discount] @doc(description: "Information about the final discount amount for the base product, including discounts on options.")
  124. quantity_invoiced: Float @doc(description: "The number of invoiced items.")
  125. }
  126. type InvoiceItem implements InvoiceItemInterface {
  127. }
  128. type InvoiceTotal @doc(description: "Contains price details from an invoice."){
  129. subtotal: Money! @doc(description: "The subtotal of the invoice, excluding shipping, discounts, and taxes.")
  130. discounts: [Discount] @doc(description: "The applied discounts to the invoice.")
  131. total_tax: Money! @doc(description: "The amount of tax applied to the invoice.")
  132. taxes: [TaxItem] @doc(description: "The invoice tax details.")
  133. grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes.")
  134. base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency.")
  135. total_shipping: Money! @doc(description: "The shipping amount for the invoice.")
  136. shipping_handling: ShippingHandling @doc(description: "Details about the shipping and handling costs for the invoice.")
  137. }
  138. type ShippingHandling @doc(description: "Contains details about shipping and handling costs.") {
  139. total_amount: Money! @doc(description: "The total amount for shipping.")
  140. amount_including_tax: Money @doc(description: "The shipping amount, including tax.")
  141. amount_excluding_tax: Money @doc(description: "The shipping amount, excluding tax.")
  142. taxes: [TaxItem] @doc(description: "Details about taxes applied for shipping.")
  143. discounts: [ShippingDiscount] @doc(description: "The applied discounts to the shipping.")
  144. }
  145. type ShippingDiscount @doc(description:"Defines an individual shipping discount. This discount can be applied to shipping.") {
  146. amount: Money! @doc(description:"The amount of the discount.")
  147. }
  148. type OrderShipment @doc(description: "Contains order shipment details.") {
  149. id: ID! @doc(description: "The unique ID for a `OrderShipment` object.")
  150. number: String! @doc(description: "The sequential credit shipment number.")
  151. tracking: [ShipmentTracking] @doc(description: "An array of shipment tracking details.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentTracking")
  152. items: [ShipmentItemInterface] @doc(description: "An array of items included in the shipment.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Shipment\\ShipmentItems")
  153. comments: [SalesCommentItem] @doc(description: "Comments added to the shipment.")
  154. }
  155. type SalesCommentItem @doc(description: "Contains details about a comment.") {
  156. timestamp: String! @doc(description: "The timestamp of the comment.")
  157. message: String! @doc(description: "The text of the message.")
  158. }
  159. interface ShipmentItemInterface @doc(description: "Order shipment item details.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\ShipmentItem"){
  160. id: ID! @doc(description: "The unique ID for a `ShipmentItemInterface` object.")
  161. order_item: OrderItemInterface @doc(description: "The order item associated with the shipment item.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem")
  162. product_name: String @doc(description: "The name of the base product.")
  163. product_sku: String! @doc(description: "The SKU of the base product.")
  164. product_sale_price: Money! @doc(description: "The sale price for the base product.")
  165. quantity_shipped: Float! @doc(description: "The number of shipped items.")
  166. }
  167. type ShipmentItem implements ShipmentItemInterface {
  168. }
  169. type ShipmentTracking @doc(description: "Contains order shipment tracking details.") {
  170. title: String! @doc(description: "The shipment tracking title.")
  171. carrier: String! @doc(description: "The shipping carrier for the order delivery.")
  172. number: String @doc(description: "The tracking number of the order shipment.")
  173. }
  174. type OrderPaymentMethod @doc(description: "Contains details about the payment method used to pay for the order.") {
  175. name: String! @doc(description: "The label that describes the payment method.")
  176. type: String! @doc(description: "The payment method code that indicates how the order was paid for.")
  177. additional_data: [KeyValue] @doc(description: "Additional data per payment method type.")
  178. }
  179. type CreditMemo @doc(description: "Contains credit memo details.") {
  180. id: ID! @doc(description: "The unique ID for a `CreditMemo` object.")
  181. number: String! @doc(description: "The sequential credit memo number.")
  182. items: [CreditMemoItemInterface] @doc(description: "An array containing details about refunded items.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoItems")
  183. total: CreditMemoTotal @doc(description: "Details about the total refunded amount.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoTotal")
  184. comments: [SalesCommentItem] @doc(description: "Comments on the credit memo.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\CreditMemo\\CreditMemoComments")
  185. }
  186. interface CreditMemoItemInterface @doc(description: "Credit memo item details.") @typeResolver(class: "Magento\\SalesGraphQl\\Model\\TypeResolver\\CreditMemoItem") {
  187. id: ID! @doc(description: "The unique ID for a `CreditMemoItemInterface` object.")
  188. order_item: OrderItemInterface @doc(description: "The order item the credit memo is applied to.") @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\OrderItem")
  189. product_name: String @doc(description: "The name of the base product.")
  190. product_sku: String! @doc(description: "The SKU of the base product.")
  191. product_sale_price: Money! @doc(description: "The sale price for the base product, including selected options.")
  192. discounts: [Discount] @doc(description: "Details about the final discount amount for the base product, including discounts on options.")
  193. quantity_refunded: Float @doc(description: "The number of refunded items.")
  194. }
  195. type CreditMemoItem implements CreditMemoItemInterface {
  196. }
  197. type CreditMemoTotal @doc(description: "Contains credit memo price details.") {
  198. subtotal: Money! @doc(description: "The subtotal of the invoice, excluding shipping, discounts, and taxes.")
  199. discounts: [Discount] @doc(description: "The applied discounts to the credit memo.")
  200. total_tax: Money! @doc(description: "The amount of tax applied to the credit memo.")
  201. taxes: [TaxItem] @doc(description: "The credit memo tax details.")
  202. grand_total: Money! @doc(description: "The final total amount, including shipping, discounts, and taxes.")
  203. base_grand_total: Money! @doc(description: "The final base grand total amount in the base currency.")
  204. total_shipping: Money! @doc(description: "The shipping amount for the credit memo.")
  205. shipping_handling: ShippingHandling @doc(description: "Details about the shipping and handling costs for the credit memo.")
  206. adjustment: Money! @doc(description: "An adjustment manually applied to the order.")
  207. }
  208. type KeyValue @doc(description: "Contains a key-value pair.") {
  209. name: String @doc(description: "The name part of the key/value pair.")
  210. value: String @doc(description: "The value part of the key/value pair.")
  211. }
  212. enum CheckoutUserInputErrorCodes {
  213. REORDER_NOT_AVAILABLE
  214. PRODUCT_NOT_FOUND
  215. NOT_SALABLE
  216. INSUFFICIENT_STOCK
  217. UNDEFINED
  218. }