shared-definitions.ts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. import gql from 'graphql-tag';
  2. import {
  3. ADMINISTRATOR_FRAGMENT,
  4. ASSET_FRAGMENT,
  5. CHANNEL_FRAGMENT,
  6. COLLECTION_FRAGMENT,
  7. COUNTRY_FRAGMENT,
  8. CURRENT_USER_FRAGMENT,
  9. CUSTOMER_FRAGMENT,
  10. CUSTOMER_GROUP_FRAGMENT,
  11. FACET_WITH_VALUES_FRAGMENT,
  12. FULFILLMENT_FRAGMENT,
  13. GLOBAL_SETTINGS_FRAGMENT,
  14. ORDER_FRAGMENT,
  15. ORDER_WITH_LINES_FRAGMENT,
  16. PRODUCT_OPTION_GROUP_FRAGMENT,
  17. PRODUCT_VARIANT_FRAGMENT,
  18. PRODUCT_WITH_OPTIONS_FRAGMENT,
  19. PRODUCT_WITH_VARIANTS_FRAGMENT,
  20. PROMOTION_FRAGMENT,
  21. ROLE_FRAGMENT,
  22. SHIPPING_METHOD_FRAGMENT,
  23. TAX_RATE_FRAGMENT,
  24. VARIANT_WITH_STOCK_FRAGMENT,
  25. } from './fragments';
  26. export const CREATE_ADMINISTRATOR = gql`
  27. mutation CreateAdministrator($input: CreateAdministratorInput!) {
  28. createAdministrator(input: $input) {
  29. ...Administrator
  30. }
  31. }
  32. ${ADMINISTRATOR_FRAGMENT}
  33. `;
  34. export const UPDATE_PRODUCT = gql`
  35. mutation UpdateProduct($input: UpdateProductInput!) {
  36. updateProduct(input: $input) {
  37. ...ProductWithVariants
  38. }
  39. }
  40. ${PRODUCT_WITH_VARIANTS_FRAGMENT}
  41. `;
  42. export const CREATE_PRODUCT = gql`
  43. mutation CreateProduct($input: CreateProductInput!) {
  44. createProduct(input: $input) {
  45. ...ProductWithVariants
  46. }
  47. }
  48. ${PRODUCT_WITH_VARIANTS_FRAGMENT}
  49. `;
  50. export const GET_PRODUCT_WITH_VARIANTS = gql`
  51. query GetProductWithVariants($id: ID, $slug: String) {
  52. product(slug: $slug, id: $id) {
  53. ...ProductWithVariants
  54. }
  55. }
  56. ${PRODUCT_WITH_VARIANTS_FRAGMENT}
  57. `;
  58. export const GET_PRODUCT_LIST = gql`
  59. query GetProductList($options: ProductListOptions) {
  60. products(options: $options) {
  61. items {
  62. id
  63. languageCode
  64. name
  65. slug
  66. featuredAsset {
  67. id
  68. preview
  69. }
  70. }
  71. totalItems
  72. }
  73. }
  74. `;
  75. export const CREATE_PRODUCT_VARIANTS = gql`
  76. mutation CreateProductVariants($input: [CreateProductVariantInput!]!) {
  77. createProductVariants(input: $input) {
  78. ...ProductVariant
  79. }
  80. }
  81. ${PRODUCT_VARIANT_FRAGMENT}
  82. `;
  83. export const UPDATE_PRODUCT_VARIANTS = gql`
  84. mutation UpdateProductVariants($input: [UpdateProductVariantInput!]!) {
  85. updateProductVariants(input: $input) {
  86. ...ProductVariant
  87. }
  88. }
  89. ${PRODUCT_VARIANT_FRAGMENT}
  90. `;
  91. export const UPDATE_TAX_RATE = gql`
  92. mutation UpdateTaxRate($input: UpdateTaxRateInput!) {
  93. updateTaxRate(input: $input) {
  94. ...TaxRate
  95. }
  96. }
  97. ${TAX_RATE_FRAGMENT}
  98. `;
  99. export const CREATE_FACET = gql`
  100. mutation CreateFacet($input: CreateFacetInput!) {
  101. createFacet(input: $input) {
  102. ...FacetWithValues
  103. }
  104. }
  105. ${FACET_WITH_VALUES_FRAGMENT}
  106. `;
  107. export const UPDATE_FACET = gql`
  108. mutation UpdateFacet($input: UpdateFacetInput!) {
  109. updateFacet(input: $input) {
  110. ...FacetWithValues
  111. }
  112. }
  113. ${FACET_WITH_VALUES_FRAGMENT}
  114. `;
  115. export const GET_CUSTOMER_LIST = gql`
  116. query GetCustomerList($options: CustomerListOptions) {
  117. customers(options: $options) {
  118. items {
  119. id
  120. title
  121. firstName
  122. lastName
  123. emailAddress
  124. phoneNumber
  125. user {
  126. id
  127. verified
  128. }
  129. }
  130. totalItems
  131. }
  132. }
  133. `;
  134. export const GET_ASSET_LIST = gql`
  135. query GetAssetList($options: AssetListOptions) {
  136. assets(options: $options) {
  137. items {
  138. ...Asset
  139. }
  140. totalItems
  141. }
  142. }
  143. ${ASSET_FRAGMENT}
  144. `;
  145. export const CREATE_ROLE = gql`
  146. mutation CreateRole($input: CreateRoleInput!) {
  147. createRole(input: $input) {
  148. ...Role
  149. }
  150. }
  151. ${ROLE_FRAGMENT}
  152. `;
  153. export const CREATE_COLLECTION = gql`
  154. mutation CreateCollection($input: CreateCollectionInput!) {
  155. createCollection(input: $input) {
  156. ...Collection
  157. }
  158. }
  159. ${COLLECTION_FRAGMENT}
  160. `;
  161. export const UPDATE_COLLECTION = gql`
  162. mutation UpdateCollection($input: UpdateCollectionInput!) {
  163. updateCollection(input: $input) {
  164. ...Collection
  165. }
  166. }
  167. ${COLLECTION_FRAGMENT}
  168. `;
  169. export const GET_CUSTOMER = gql`
  170. query GetCustomer($id: ID!, $orderListOptions: OrderListOptions) {
  171. customer(id: $id) {
  172. ...Customer
  173. orders(options: $orderListOptions) {
  174. items {
  175. id
  176. code
  177. state
  178. total
  179. currencyCode
  180. updatedAt
  181. }
  182. totalItems
  183. }
  184. }
  185. }
  186. ${CUSTOMER_FRAGMENT}
  187. `;
  188. export const ATTEMPT_LOGIN = gql`
  189. mutation AttemptLogin($username: String!, $password: String!, $rememberMe: Boolean) {
  190. login(username: $username, password: $password, rememberMe: $rememberMe) {
  191. ...CurrentUser
  192. }
  193. }
  194. ${CURRENT_USER_FRAGMENT}
  195. `;
  196. export const GET_COUNTRY_LIST = gql`
  197. query GetCountryList($options: CountryListOptions) {
  198. countries(options: $options) {
  199. items {
  200. id
  201. code
  202. name
  203. enabled
  204. }
  205. totalItems
  206. }
  207. }
  208. `;
  209. export const UPDATE_COUNTRY = gql`
  210. mutation UpdateCountry($input: UpdateCountryInput!) {
  211. updateCountry(input: $input) {
  212. ...Country
  213. }
  214. }
  215. ${COUNTRY_FRAGMENT}
  216. `;
  217. export const GET_FACET_LIST = gql`
  218. query GetFacetList($options: FacetListOptions) {
  219. facets(options: $options) {
  220. items {
  221. ...FacetWithValues
  222. }
  223. totalItems
  224. }
  225. }
  226. ${FACET_WITH_VALUES_FRAGMENT}
  227. `;
  228. export const DELETE_PRODUCT = gql`
  229. mutation DeleteProduct($id: ID!) {
  230. deleteProduct(id: $id) {
  231. result
  232. }
  233. }
  234. `;
  235. export const GET_PRODUCT_SIMPLE = gql`
  236. query GetProductSimple($id: ID, $slug: String) {
  237. product(slug: $slug, id: $id) {
  238. id
  239. slug
  240. }
  241. }
  242. `;
  243. export const GET_STOCK_MOVEMENT = gql`
  244. query GetStockMovement($id: ID!) {
  245. product(id: $id) {
  246. id
  247. variants {
  248. ...VariantWithStock
  249. }
  250. }
  251. }
  252. ${VARIANT_WITH_STOCK_FRAGMENT}
  253. `;
  254. export const GET_RUNNING_JOBS = gql`
  255. query GetRunningJobs($options: JobListOptions) {
  256. jobs(options: $options) {
  257. items {
  258. id
  259. queueName
  260. state
  261. isSettled
  262. duration
  263. }
  264. totalItems
  265. }
  266. }
  267. `;
  268. export const CREATE_PROMOTION = gql`
  269. mutation CreatePromotion($input: CreatePromotionInput!) {
  270. createPromotion(input: $input) {
  271. ...Promotion
  272. ... on ErrorResult {
  273. errorCode
  274. message
  275. }
  276. }
  277. }
  278. ${PROMOTION_FRAGMENT}
  279. `;
  280. export const ME = gql`
  281. query Me {
  282. me {
  283. ...CurrentUser
  284. }
  285. }
  286. ${CURRENT_USER_FRAGMENT}
  287. `;
  288. export const CREATE_CHANNEL = gql`
  289. mutation CreateChannel($input: CreateChannelInput!) {
  290. createChannel(input: $input) {
  291. ...Channel
  292. ... on LanguageNotAvailableError {
  293. errorCode
  294. message
  295. languageCode
  296. }
  297. }
  298. }
  299. ${CHANNEL_FRAGMENT}
  300. `;
  301. export const DELETE_PRODUCT_VARIANT = gql`
  302. mutation DeleteProductVariant($id: ID!) {
  303. deleteProductVariant(id: $id) {
  304. result
  305. message
  306. }
  307. }
  308. `;
  309. export const ASSIGN_PRODUCT_TO_CHANNEL = gql`
  310. mutation AssignProductsToChannel($input: AssignProductsToChannelInput!) {
  311. assignProductsToChannel(input: $input) {
  312. ...ProductWithVariants
  313. }
  314. }
  315. ${PRODUCT_WITH_VARIANTS_FRAGMENT}
  316. `;
  317. export const REMOVE_PRODUCT_FROM_CHANNEL = gql`
  318. mutation RemoveProductsFromChannel($input: RemoveProductsFromChannelInput!) {
  319. removeProductsFromChannel(input: $input) {
  320. ...ProductWithVariants
  321. }
  322. }
  323. ${PRODUCT_WITH_VARIANTS_FRAGMENT}
  324. `;
  325. export const ASSIGN_PRODUCTVARIANT_TO_CHANNEL = gql`
  326. mutation AssignProductVariantsToChannel($input: AssignProductVariantsToChannelInput!) {
  327. assignProductVariantsToChannel(input: $input) {
  328. ...ProductVariant
  329. }
  330. }
  331. ${PRODUCT_VARIANT_FRAGMENT}
  332. `;
  333. export const REMOVE_PRODUCTVARIANT_FROM_CHANNEL = gql`
  334. mutation RemoveProductVariantsFromChannel($input: RemoveProductVariantsFromChannelInput!) {
  335. removeProductVariantsFromChannel(input: $input) {
  336. ...ProductVariant
  337. }
  338. }
  339. ${PRODUCT_VARIANT_FRAGMENT}
  340. `;
  341. export const UPDATE_ASSET = gql`
  342. mutation UpdateAsset($input: UpdateAssetInput!) {
  343. updateAsset(input: $input) {
  344. ...Asset
  345. ... on Asset {
  346. tags {
  347. id
  348. value
  349. }
  350. focalPoint {
  351. x
  352. y
  353. }
  354. }
  355. }
  356. }
  357. ${ASSET_FRAGMENT}
  358. `;
  359. export const DELETE_ASSET = gql`
  360. mutation DeleteAsset($id: ID!, $force: Boolean) {
  361. deleteAsset(id: $id, force: $force) {
  362. result
  363. message
  364. }
  365. }
  366. `;
  367. export const UPDATE_CHANNEL = gql`
  368. mutation UpdateChannel($input: UpdateChannelInput!) {
  369. updateChannel(input: $input) {
  370. ...Channel
  371. ... on LanguageNotAvailableError {
  372. errorCode
  373. message
  374. languageCode
  375. }
  376. }
  377. }
  378. ${CHANNEL_FRAGMENT}
  379. `;
  380. export const GET_CUSTOMER_HISTORY = gql`
  381. query GetCustomerHistory($id: ID!, $options: HistoryEntryListOptions) {
  382. customer(id: $id) {
  383. id
  384. history(options: $options) {
  385. totalItems
  386. items {
  387. id
  388. administrator {
  389. id
  390. }
  391. type
  392. data
  393. }
  394. }
  395. }
  396. }
  397. `;
  398. export const GET_ORDER = gql`
  399. query GetOrder($id: ID!) {
  400. order(id: $id) {
  401. ...OrderWithLines
  402. }
  403. }
  404. ${ORDER_WITH_LINES_FRAGMENT}
  405. `;
  406. export const CREATE_CUSTOMER_GROUP = gql`
  407. mutation CreateCustomerGroup($input: CreateCustomerGroupInput!) {
  408. createCustomerGroup(input: $input) {
  409. ...CustomerGroup
  410. }
  411. }
  412. ${CUSTOMER_GROUP_FRAGMENT}
  413. `;
  414. export const REMOVE_CUSTOMERS_FROM_GROUP = gql`
  415. mutation RemoveCustomersFromGroup($groupId: ID!, $customerIds: [ID!]!) {
  416. removeCustomersFromGroup(customerGroupId: $groupId, customerIds: $customerIds) {
  417. ...CustomerGroup
  418. }
  419. }
  420. ${CUSTOMER_GROUP_FRAGMENT}
  421. `;
  422. export const CREATE_FULFILLMENT = gql`
  423. mutation CreateFulfillment($input: FulfillOrderInput!) {
  424. addFulfillmentToOrder(input: $input) {
  425. ...Fulfillment
  426. ... on ErrorResult {
  427. errorCode
  428. message
  429. }
  430. ... on CreateFulfillmentError {
  431. fulfillmentHandlerError
  432. }
  433. }
  434. }
  435. ${FULFILLMENT_FRAGMENT}
  436. `;
  437. export const TRANSIT_FULFILLMENT = gql`
  438. mutation TransitFulfillment($id: ID!, $state: String!) {
  439. transitionFulfillmentToState(id: $id, state: $state) {
  440. ...Fulfillment
  441. ... on FulfillmentStateTransitionError {
  442. errorCode
  443. message
  444. transitionError
  445. fromState
  446. toState
  447. }
  448. }
  449. }
  450. ${FULFILLMENT_FRAGMENT}
  451. `;
  452. export const GET_ORDER_FULFILLMENTS = gql`
  453. query GetOrderFulfillments($id: ID!) {
  454. order(id: $id) {
  455. id
  456. state
  457. fulfillments {
  458. id
  459. state
  460. nextStates
  461. method
  462. }
  463. }
  464. }
  465. `;
  466. export const GET_ORDERS_LIST = gql`
  467. query GetOrderList($options: OrderListOptions) {
  468. orders(options: $options) {
  469. items {
  470. ...Order
  471. }
  472. totalItems
  473. }
  474. }
  475. ${ORDER_FRAGMENT}
  476. `;
  477. export const CREATE_ADDRESS = gql`
  478. mutation CreateAddress($id: ID!, $input: CreateAddressInput!) {
  479. createCustomerAddress(customerId: $id, input: $input) {
  480. id
  481. fullName
  482. company
  483. streetLine1
  484. streetLine2
  485. city
  486. province
  487. postalCode
  488. country {
  489. code
  490. name
  491. }
  492. phoneNumber
  493. defaultShippingAddress
  494. defaultBillingAddress
  495. }
  496. }
  497. `;
  498. export const UPDATE_ADDRESS = gql`
  499. mutation UpdateAddress($input: UpdateAddressInput!) {
  500. updateCustomerAddress(input: $input) {
  501. id
  502. defaultShippingAddress
  503. defaultBillingAddress
  504. country {
  505. code
  506. name
  507. }
  508. }
  509. }
  510. `;
  511. export const CREATE_CUSTOMER = gql`
  512. mutation CreateCustomer($input: CreateCustomerInput!, $password: String) {
  513. createCustomer(input: $input, password: $password) {
  514. ...Customer
  515. ... on ErrorResult {
  516. errorCode
  517. message
  518. }
  519. }
  520. }
  521. ${CUSTOMER_FRAGMENT}
  522. `;
  523. export const UPDATE_CUSTOMER = gql`
  524. mutation UpdateCustomer($input: UpdateCustomerInput!) {
  525. updateCustomer(input: $input) {
  526. ...Customer
  527. ... on ErrorResult {
  528. errorCode
  529. message
  530. }
  531. }
  532. }
  533. ${CUSTOMER_FRAGMENT}
  534. `;
  535. export const DELETE_CUSTOMER = gql`
  536. mutation DeleteCustomer($id: ID!) {
  537. deleteCustomer(id: $id) {
  538. result
  539. }
  540. }
  541. `;
  542. export const UPDATE_CUSTOMER_NOTE = gql`
  543. mutation UpdateCustomerNote($input: UpdateCustomerNoteInput!) {
  544. updateCustomerNote(input: $input) {
  545. id
  546. data
  547. isPublic
  548. }
  549. }
  550. `;
  551. export const DELETE_CUSTOMER_NOTE = gql`
  552. mutation DeleteCustomerNote($id: ID!) {
  553. deleteCustomerNote(id: $id) {
  554. result
  555. message
  556. }
  557. }
  558. `;
  559. export const UPDATE_CUSTOMER_GROUP = gql`
  560. mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) {
  561. updateCustomerGroup(input: $input) {
  562. ...CustomerGroup
  563. }
  564. }
  565. ${CUSTOMER_GROUP_FRAGMENT}
  566. `;
  567. export const DELETE_CUSTOMER_GROUP = gql`
  568. mutation DeleteCustomerGroup($id: ID!) {
  569. deleteCustomerGroup(id: $id) {
  570. result
  571. message
  572. }
  573. }
  574. `;
  575. export const GET_CUSTOMER_GROUPS = gql`
  576. query GetCustomerGroups($options: CustomerGroupListOptions) {
  577. customerGroups(options: $options) {
  578. items {
  579. id
  580. name
  581. }
  582. totalItems
  583. }
  584. }
  585. `;
  586. export const GET_CUSTOMER_GROUP = gql`
  587. query GetCustomerGroup($id: ID!, $options: CustomerListOptions) {
  588. customerGroup(id: $id) {
  589. id
  590. name
  591. customers(options: $options) {
  592. items {
  593. id
  594. }
  595. totalItems
  596. }
  597. }
  598. }
  599. `;
  600. export const ADD_CUSTOMERS_TO_GROUP = gql`
  601. mutation AddCustomersToGroup($groupId: ID!, $customerIds: [ID!]!) {
  602. addCustomersToGroup(customerGroupId: $groupId, customerIds: $customerIds) {
  603. ...CustomerGroup
  604. }
  605. }
  606. ${CUSTOMER_GROUP_FRAGMENT}
  607. `;
  608. export const GET_CUSTOMER_WITH_GROUPS = gql`
  609. query GetCustomerWithGroups($id: ID!) {
  610. customer(id: $id) {
  611. id
  612. groups {
  613. id
  614. name
  615. }
  616. }
  617. }
  618. `;
  619. export const ADMIN_TRANSITION_TO_STATE = gql`
  620. mutation AdminTransition($id: ID!, $state: String!) {
  621. transitionOrderToState(id: $id, state: $state) {
  622. ...Order
  623. ... on OrderStateTransitionError {
  624. errorCode
  625. message
  626. transitionError
  627. fromState
  628. toState
  629. }
  630. }
  631. }
  632. ${ORDER_FRAGMENT}
  633. `;
  634. export const CANCEL_ORDER = gql`
  635. mutation CancelOrder($input: CancelOrderInput!) {
  636. cancelOrder(input: $input) {
  637. ...CanceledOrder
  638. ... on ErrorResult {
  639. errorCode
  640. message
  641. }
  642. }
  643. }
  644. fragment CanceledOrder on Order {
  645. id
  646. lines {
  647. quantity
  648. items {
  649. id
  650. cancelled
  651. }
  652. }
  653. }
  654. `;
  655. export const UPDATE_GLOBAL_SETTINGS = gql`
  656. mutation UpdateGlobalSettings($input: UpdateGlobalSettingsInput!) {
  657. updateGlobalSettings(input: $input) {
  658. ...GlobalSettings
  659. ... on ErrorResult {
  660. errorCode
  661. message
  662. }
  663. }
  664. }
  665. ${GLOBAL_SETTINGS_FRAGMENT}
  666. `;
  667. export const UPDATE_ROLE = gql`
  668. mutation UpdateRole($input: UpdateRoleInput!) {
  669. updateRole(input: $input) {
  670. ...Role
  671. }
  672. }
  673. ${ROLE_FRAGMENT}
  674. `;
  675. export const GET_PRODUCTS_WITH_VARIANT_PRICES = gql`
  676. query GetProductsWithVariantPrices {
  677. products {
  678. items {
  679. id
  680. slug
  681. variants {
  682. id
  683. price
  684. priceWithTax
  685. sku
  686. facetValues {
  687. id
  688. code
  689. }
  690. }
  691. }
  692. }
  693. }
  694. `;
  695. export const CREATE_PRODUCT_OPTION_GROUP = gql`
  696. mutation CreateProductOptionGroup($input: CreateProductOptionGroupInput!) {
  697. createProductOptionGroup(input: $input) {
  698. ...ProductOptionGroup
  699. }
  700. }
  701. ${PRODUCT_OPTION_GROUP_FRAGMENT}
  702. `;
  703. export const ADD_OPTION_GROUP_TO_PRODUCT = gql`
  704. mutation AddOptionGroupToProduct($productId: ID!, $optionGroupId: ID!) {
  705. addOptionGroupToProduct(productId: $productId, optionGroupId: $optionGroupId) {
  706. ...ProductWithOptions
  707. }
  708. }
  709. ${PRODUCT_WITH_OPTIONS_FRAGMENT}
  710. `;
  711. export const CREATE_SHIPPING_METHOD = gql`
  712. mutation CreateShippingMethod($input: CreateShippingMethodInput!) {
  713. createShippingMethod(input: $input) {
  714. ...ShippingMethod
  715. }
  716. }
  717. ${SHIPPING_METHOD_FRAGMENT}
  718. `;
  719. export const SETTLE_PAYMENT = gql`
  720. mutation SettlePayment($id: ID!) {
  721. settlePayment(id: $id) {
  722. ...Payment
  723. ... on ErrorResult {
  724. errorCode
  725. message
  726. }
  727. ... on SettlePaymentError {
  728. paymentErrorMessage
  729. }
  730. }
  731. }
  732. fragment Payment on Payment {
  733. id
  734. state
  735. metadata
  736. }
  737. `;
  738. export const GET_ORDER_HISTORY = gql`
  739. query GetOrderHistory($id: ID!, $options: HistoryEntryListOptions) {
  740. order(id: $id) {
  741. id
  742. history(options: $options) {
  743. totalItems
  744. items {
  745. id
  746. type
  747. administrator {
  748. id
  749. }
  750. data
  751. }
  752. }
  753. }
  754. }
  755. `;
  756. export const UPDATE_SHIPPING_METHOD = gql`
  757. mutation UpdateShippingMethod($input: UpdateShippingMethodInput!) {
  758. updateShippingMethod(input: $input) {
  759. ...ShippingMethod
  760. }
  761. }
  762. ${SHIPPING_METHOD_FRAGMENT}
  763. `;