interface.graphql 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. # An object with an ID field to support global identification, in accordance with the
  2. # Relay specification.
  3. # This interface is used by the node
  4. # and nodes queries.
  5. interface Node {
  6. # A globally-unique identifier.
  7. id: ID!
  8. }
  9. # The subject line of a comment event.
  10. interface CommentEventSubject {
  11. # A globally-unique identifier.
  12. id: ID!
  13. # Whether the timeline subject has a timeline comment. If true, then a timeline comment exists.
  14. hasTimelineComment: Boolean!
  15. }
  16. # Represents an object that has a list of events.
  17. interface HasEvents {
  18. # The paginated list of events associated with the host subject.
  19. events(
  20. first: Int
  21. after: String
  22. last: Int
  23. before: String
  24. reverse: Boolean = false
  25. sortKey: EventSortKeys = ID
  26. query: String
  27. ): EventConnection!
  28. }
  29. # Events chronicle resource activities such as the creation of an article, the fulfillment of an order, or the
  30. # addition of a product.
  31. interface Event {
  32. # The name of the app that created the event.
  33. appTitle: String
  34. # Whether the event was created by an app.
  35. attributeToApp: Boolean!
  36. # Whether the event was caused by an admin user.
  37. attributeToUser: Boolean!
  38. # The date and time when the event was created.
  39. createdAt: DateTime!
  40. # Whether the event is critical.
  41. criticalAlert: Boolean!
  42. # A globally-unique identifier.
  43. id: ID!
  44. # Human readable text that describes the event.
  45. message: FormattedString!
  46. }
  47. # Represents information about the metafields associated to the specified resource.
  48. interface HasMetafields {
  49. # Returns a metafield by namespace and key that belongs to the resource.
  50. metafield(namespace: String!key: String!): Metafield
  51. # List of metafields that belong to the resource.
  52. metafields(
  53. namespace: String
  54. first: Int
  55. after: String
  56. last: Int
  57. before: String
  58. reverse: Boolean = false
  59. ): MetafieldConnection!
  60. # Returns a private metafield by namespace and key that belongs to the resource.
  61. privateMetafield(namespace: String!key: String!): PrivateMetafield
  62. # List of private metafields that belong to the resource.
  63. privateMetafields(
  64. namespace: String
  65. first: Int
  66. after: String
  67. last: Int
  68. before: String
  69. reverse: Boolean = false
  70. ): PrivateMetafieldConnection!
  71. }
  72. # Interoperability metadata for types that directly correspond to a REST Admin API resource.
  73. # For example, on the Product type, LegacyInteroperability returns metadata for the corresponding Product object in the REST Admin API.
  74. interface LegacyInteroperability {
  75. # The ID of the corresponding resource in the REST Admin API.
  76. legacyResourceId: UnsignedInt64!
  77. }
  78. # Localization extensions associated with the specified resource. For example, the tax id for government invoice.
  79. interface HasLocalizationExtensions {
  80. # List of localization extensions for the resource.
  81. localizationExtensions(
  82. countryCodes: [CountryCode!]
  83. purposes: [LocalizationExtensionPurpose!]
  84. first: Int
  85. after: String
  86. last: Int
  87. before: String
  88. reverse: Boolean = false
  89. ): LocalizationExtensionConnection!
  90. }
  91. # Resources that metafield definitions can be applied to.
  92. interface HasMetafieldDefinitions {
  93. # List of metafield definitions.
  94. metafieldDefinitions(
  95. namespace: String
  96. pinnedStatus: MetafieldDefinitionPinnedStatus = ANY
  97. first: Int
  98. after: String
  99. last: Int
  100. before: String
  101. reverse: Boolean = false
  102. sortKey: MetafieldDefinitionSortKeys = ID
  103. query: String
  104. ): MetafieldDefinitionConnection!
  105. }
  106. # A default cursor that you can use in queries to paginate your results. Each edge in a connection can
  107. # return a cursor, which is a reference to the edge's position in the connection. You can use an edge's cursor as
  108. # the starting point to retrieve the nodes before or after it in a connection.
  109. #
  110. # To learn more about using cursor-based pagination, refer to
  111. # Paginating results with GraphQL.
  112. interface Navigable {
  113. # A default cursor that returns the single next record, sorted ascending by ID.
  114. defaultCursor: String!
  115. }
  116. # Discount applications capture the intentions of a discount source at
  117. # the time of application on an order's line items or shipping lines.
  118. #
  119. # Discount applications don't represent the actual final amount discounted on a line (line item or shipping line). The actual amount discounted on a line is represented by the DiscountAllocation object.
  120. interface DiscountApplication {
  121. # The method by which the discount's value is applied to its entitled items.
  122. allocationMethod: DiscountApplicationAllocationMethod!
  123. # An ordered index that can be used to identify the discount application and indicate the precedence
  124. # of the discount application for calculations.
  125. index: Int!
  126. # How the discount amount is distributed on the discounted lines.
  127. targetSelection: DiscountApplicationTargetSelection!
  128. # Whether the discount is applied on line items or shipping lines.
  129. targetType: DiscountApplicationTargetType!
  130. # The value of the discount application.
  131. value: PricingValue!
  132. }
  133. # Published translations associated with the resource.
  134. interface HasPublishedTranslations {
  135. # The translations associated with the resource.
  136. translations(locale: String!marketId: ID): [PublishedTranslation!]!
  137. }
  138. # Represents an error in the input of a mutation.
  139. interface DisplayableError {
  140. # The path to the input field that caused the error.
  141. field: [String!]
  142. # The error message.
  143. message: String!
  144. }
  145. # Services and features purchased once by the store.
  146. interface AppPurchase {
  147. # The date and time when the app purchase occurred.
  148. createdAt: DateTime!
  149. # The name of the app purchase.
  150. name: String!
  151. # The amount to be charged to the store for the app purchase.
  152. price: MoneyV2!
  153. # The status of the app purchase.
  154. status: AppPurchaseStatus!
  155. # Whether the app purchase is a test transaction.
  156. test: Boolean!
  157. }
  158. # Represents a resource that can be published to a channel.
  159. # A publishable resource can be either a Product or Collection.
  160. interface Publishable {
  161. # The number of publications a resource is published to without feedback errors.
  162. availablePublicationCount: Int!
  163. # The number of publications a resource is published on.
  164. publicationCount(onlyPublished: Boolean = true): Int!
  165. # Check to see whether the resource is published to the calling app's publication.
  166. publishedOnCurrentPublication: Boolean!
  167. # Check to see whether the resource is published to a given publication.
  168. publishedOnPublication(publicationId: ID!): Boolean!
  169. # The list of resources that are published to a publication.
  170. resourcePublications(
  171. onlyPublished: Boolean = true
  172. first: Int
  173. after: String
  174. last: Int
  175. before: String
  176. reverse: Boolean = false
  177. ): ResourcePublicationConnection!
  178. # The list of resources that are either published or staged to be published to a publication.
  179. resourcePublicationsV2(
  180. onlyPublished: Boolean = true
  181. first: Int
  182. after: String
  183. last: Int
  184. before: String
  185. reverse: Boolean = false
  186. ): ResourcePublicationV2Connection!
  187. # The list of publications that the resource is not published to.
  188. unpublishedPublications(
  189. first: Int
  190. after: String
  191. last: Int
  192. before: String
  193. reverse: Boolean = false
  194. ): PublicationConnection!
  195. }
  196. # Represents a session preceding an order, often used for building a timeline of events leading to an order.
  197. interface CustomerMoment {
  198. # The date and time when the customer's session occurred.
  199. occurredAt: DateTime!
  200. }
  201. # Represents subscription contract common fields.
  202. interface SubscriptionContractBase {
  203. # The subscription app that the subscription contract is registered to.
  204. app: App
  205. # The URL of the subscription contract page on the subscription app.
  206. appAdminUrl: URL
  207. # The currency that's used for the subscription contract.
  208. currencyCode: CurrencyCode!
  209. # A list of the custom attributes to be added to the generated orders.
  210. customAttributes: [Attribute!]!
  211. # The customer to whom the subscription contract belongs.
  212. customer: Customer
  213. # The customer payment method that's used for the subscription contract.
  214. customerPaymentMethod(showRevoked: Boolean = false): CustomerPaymentMethod
  215. # The delivery method for each billing of the subscription contract.
  216. deliveryMethod: SubscriptionDeliveryMethod
  217. # The delivery price for each billing of the subscription contract.
  218. deliveryPrice: MoneyV2!
  219. # The list of subscription discounts associated with the subscription contract.
  220. discounts(
  221. first: Int
  222. after: String
  223. last: Int
  224. before: String
  225. reverse: Boolean = false
  226. ): SubscriptionManualDiscountConnection!
  227. # The number of lines associated with the subscription contract.
  228. lineCount: Int!
  229. # The list of subscription lines associated with the subscription contract.
  230. lines(
  231. first: Int
  232. after: String
  233. last: Int
  234. before: String
  235. reverse: Boolean = false
  236. ): SubscriptionLineConnection!
  237. # The note field that will be applied to the generated orders.
  238. note: String
  239. # A list of the subscription contract's orders.
  240. orders(
  241. first: Int
  242. after: String
  243. last: Int
  244. before: String
  245. reverse: Boolean = false
  246. ): OrderConnection!
  247. # The date and time when the subscription contract was updated.
  248. updatedAt: DateTime!
  249. }
  250. # A contract between a merchant and a customer to do business.
  251. # Shopify creates a sales agreement whenever an order is placed, edited, or refunded.
  252. # A sales agreement has one or more sales records, which provide itemized details about the initial agreement or subsequent changes made to the order.
  253. # For example, when a customer places an order, Shopify creates the order, generates a sales agreement, and records a sale for each line item purchased in the order.
  254. # A sale record is specific to a type of order line. Order lines can represent different things such as a purchased product, a tip added by a customer, shipping costs collected at checkout, and more.
  255. interface SalesAgreement {
  256. # The application that created the agreement.
  257. app: App
  258. # The date and time at which the agreement occured.
  259. happenedAt: DateTime!
  260. # The unique identifier for the agreement.
  261. id: ID!
  262. # The reason the agremeent was created.
  263. reason: OrderActionType!
  264. # The sales associated with the agreement.
  265. sales(
  266. first: Int
  267. after: String
  268. last: Int
  269. before: String
  270. reverse: Boolean = false
  271. ): SaleConnection!
  272. # The staff member associated with the agreement.
  273. user: StaffMember
  274. }
  275. # An individual sale record associated with a sales agreement.
  276. # Every money value in an order's sales data is represented in the currency's smallest unit.
  277. # When amounts are divided across multiple line items, such as taxes or order discounts, the amounts might not divide evenly across all of the line items on the order.
  278. # To address this, the remaining currency units that couldn't be divided evenly are allocated one at a time, starting with the first line item, until they are all accounted for.
  279. # In aggregate, the values sum up correctly. In isolation, one line item might have a different tax or discount amount than another line item of the same price, before taxes and discounts.
  280. # This is because the amount could not be divided evenly across the items. The allocation of currency units across line items is immutable.
  281. # After they are allocated, currency units are never reallocated or redistributed among the line items.
  282. interface Sale {
  283. # The type of order action that the sale represents.
  284. actionType: SaleActionType!
  285. # The unique identifier for the sale.
  286. id: ID!
  287. # The line type assocated with the sale.
  288. lineType: SaleLineType!
  289. # The number of units either ordered or intended to be returned.
  290. quantity: Int
  291. # All individual taxes associated with the sale.
  292. taxes: [SaleTax!]!
  293. # The total sale amount after taxes and discounts.
  294. totalAmount: MoneyBag!
  295. # The total discounts allocated to the sale after taxes.
  296. totalDiscountAmountAfterTaxes: MoneyBag!
  297. # The total discounts allocated to the sale before taxes.
  298. totalDiscountAmountBeforeTaxes: MoneyBag!
  299. # The total amount of taxes for the sale.
  300. totalTaxAmount: MoneyBag!
  301. }
  302. # A geographic region which comprises a market.
  303. interface MarketRegion {
  304. # A globally-unique identifier.
  305. id: ID!
  306. # The name of the region.
  307. name: String!
  308. }
  309. # Online Store preview URL of the object.
  310. interface OnlineStorePreviewable {
  311. # The online store preview URL.
  312. onlineStorePreviewUrl: URL
  313. }
  314. # Represents a media interface.
  315. interface Media {
  316. # A word or phrase to share the nature or contents of a media.
  317. alt: String
  318. # The media content type.
  319. mediaContentType: MediaContentType!
  320. # Any errors which have occurred on the media.
  321. mediaErrors: [MediaError!]!
  322. # The warnings attached to the media.
  323. mediaWarnings: [MediaWarning!]!
  324. # The preview image for the media.
  325. preview: MediaPreviewImage
  326. # Current status of the media.
  327. status: MediaStatus!
  328. }
  329. # A file interface.
  330. interface File {
  331. # A word or phrase to describe the contents or the function of a file.
  332. alt: String
  333. # The date and time (ISO 8601 format) when the file was created.
  334. createdAt: DateTime!
  335. # Any errors that have occurred on the file.
  336. fileErrors: [FileError!]!
  337. # The status of the file.
  338. fileStatus: FileStatus!
  339. # The preview image for the media.
  340. preview: MediaPreviewImage
  341. }
  342. # Represents selling plan pricing policy common fields.
  343. interface SellingPlanPricingPolicyBase {
  344. # The price adjustment type.
  345. adjustmentType: SellingPlanPricingPolicyAdjustmentType!
  346. # The price adjustment value.
  347. adjustmentValue: SellingPlanPricingPolicyAdjustmentValue!
  348. }