shared-definitions.ts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  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. focalPoint {
  347. x
  348. y
  349. }
  350. }
  351. }
  352. }
  353. ${ASSET_FRAGMENT}
  354. `;
  355. export const DELETE_ASSET = gql`
  356. mutation DeleteAsset($id: ID!, $force: Boolean) {
  357. deleteAsset(id: $id, force: $force) {
  358. result
  359. message
  360. }
  361. }
  362. `;
  363. export const UPDATE_CHANNEL = gql`
  364. mutation UpdateChannel($input: UpdateChannelInput!) {
  365. updateChannel(input: $input) {
  366. ...Channel
  367. ... on LanguageNotAvailableError {
  368. errorCode
  369. message
  370. languageCode
  371. }
  372. }
  373. }
  374. ${CHANNEL_FRAGMENT}
  375. `;
  376. export const GET_CUSTOMER_HISTORY = gql`
  377. query GetCustomerHistory($id: ID!, $options: HistoryEntryListOptions) {
  378. customer(id: $id) {
  379. id
  380. history(options: $options) {
  381. totalItems
  382. items {
  383. id
  384. administrator {
  385. id
  386. }
  387. type
  388. data
  389. }
  390. }
  391. }
  392. }
  393. `;
  394. export const GET_ORDER = gql`
  395. query GetOrder($id: ID!) {
  396. order(id: $id) {
  397. ...OrderWithLines
  398. }
  399. }
  400. ${ORDER_WITH_LINES_FRAGMENT}
  401. `;
  402. export const CREATE_CUSTOMER_GROUP = gql`
  403. mutation CreateCustomerGroup($input: CreateCustomerGroupInput!) {
  404. createCustomerGroup(input: $input) {
  405. ...CustomerGroup
  406. }
  407. }
  408. ${CUSTOMER_GROUP_FRAGMENT}
  409. `;
  410. export const REMOVE_CUSTOMERS_FROM_GROUP = gql`
  411. mutation RemoveCustomersFromGroup($groupId: ID!, $customerIds: [ID!]!) {
  412. removeCustomersFromGroup(customerGroupId: $groupId, customerIds: $customerIds) {
  413. ...CustomerGroup
  414. }
  415. }
  416. ${CUSTOMER_GROUP_FRAGMENT}
  417. `;
  418. export const CREATE_FULFILLMENT = gql`
  419. mutation CreateFulfillment($input: FulfillOrderInput!) {
  420. addFulfillmentToOrder(input: $input) {
  421. ...Fulfillment
  422. ... on ErrorResult {
  423. errorCode
  424. message
  425. }
  426. ... on CreateFulfillmentError {
  427. fulfillmentHandlerError
  428. }
  429. }
  430. }
  431. ${FULFILLMENT_FRAGMENT}
  432. `;
  433. export const TRANSIT_FULFILLMENT = gql`
  434. mutation TransitFulfillment($id: ID!, $state: String!) {
  435. transitionFulfillmentToState(id: $id, state: $state) {
  436. ...Fulfillment
  437. ... on FulfillmentStateTransitionError {
  438. errorCode
  439. message
  440. transitionError
  441. fromState
  442. toState
  443. }
  444. }
  445. }
  446. ${FULFILLMENT_FRAGMENT}
  447. `;
  448. export const GET_ORDER_FULFILLMENTS = gql`
  449. query GetOrderFulfillments($id: ID!) {
  450. order(id: $id) {
  451. id
  452. state
  453. fulfillments {
  454. id
  455. state
  456. nextStates
  457. method
  458. }
  459. }
  460. }
  461. `;
  462. export const GET_ORDERS_LIST = gql`
  463. query GetOrderList($options: OrderListOptions) {
  464. orders(options: $options) {
  465. items {
  466. ...Order
  467. }
  468. totalItems
  469. }
  470. }
  471. ${ORDER_FRAGMENT}
  472. `;
  473. export const CREATE_ADDRESS = gql`
  474. mutation CreateAddress($id: ID!, $input: CreateAddressInput!) {
  475. createCustomerAddress(customerId: $id, input: $input) {
  476. id
  477. fullName
  478. company
  479. streetLine1
  480. streetLine2
  481. city
  482. province
  483. postalCode
  484. country {
  485. code
  486. name
  487. }
  488. phoneNumber
  489. defaultShippingAddress
  490. defaultBillingAddress
  491. }
  492. }
  493. `;
  494. export const UPDATE_ADDRESS = gql`
  495. mutation UpdateAddress($input: UpdateAddressInput!) {
  496. updateCustomerAddress(input: $input) {
  497. id
  498. defaultShippingAddress
  499. defaultBillingAddress
  500. country {
  501. code
  502. name
  503. }
  504. }
  505. }
  506. `;
  507. export const CREATE_CUSTOMER = gql`
  508. mutation CreateCustomer($input: CreateCustomerInput!, $password: String) {
  509. createCustomer(input: $input, password: $password) {
  510. ...Customer
  511. ... on ErrorResult {
  512. errorCode
  513. message
  514. }
  515. }
  516. }
  517. ${CUSTOMER_FRAGMENT}
  518. `;
  519. export const UPDATE_CUSTOMER = gql`
  520. mutation UpdateCustomer($input: UpdateCustomerInput!) {
  521. updateCustomer(input: $input) {
  522. ...Customer
  523. ... on ErrorResult {
  524. errorCode
  525. message
  526. }
  527. }
  528. }
  529. ${CUSTOMER_FRAGMENT}
  530. `;
  531. export const DELETE_CUSTOMER = gql`
  532. mutation DeleteCustomer($id: ID!) {
  533. deleteCustomer(id: $id) {
  534. result
  535. }
  536. }
  537. `;
  538. export const UPDATE_CUSTOMER_NOTE = gql`
  539. mutation UpdateCustomerNote($input: UpdateCustomerNoteInput!) {
  540. updateCustomerNote(input: $input) {
  541. id
  542. data
  543. isPublic
  544. }
  545. }
  546. `;
  547. export const DELETE_CUSTOMER_NOTE = gql`
  548. mutation DeleteCustomerNote($id: ID!) {
  549. deleteCustomerNote(id: $id) {
  550. result
  551. message
  552. }
  553. }
  554. `;
  555. export const UPDATE_CUSTOMER_GROUP = gql`
  556. mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) {
  557. updateCustomerGroup(input: $input) {
  558. ...CustomerGroup
  559. }
  560. }
  561. ${CUSTOMER_GROUP_FRAGMENT}
  562. `;
  563. export const DELETE_CUSTOMER_GROUP = gql`
  564. mutation DeleteCustomerGroup($id: ID!) {
  565. deleteCustomerGroup(id: $id) {
  566. result
  567. message
  568. }
  569. }
  570. `;
  571. export const GET_CUSTOMER_GROUPS = gql`
  572. query GetCustomerGroups($options: CustomerGroupListOptions) {
  573. customerGroups(options: $options) {
  574. items {
  575. id
  576. name
  577. }
  578. totalItems
  579. }
  580. }
  581. `;
  582. export const GET_CUSTOMER_GROUP = gql`
  583. query GetCustomerGroup($id: ID!, $options: CustomerListOptions) {
  584. customerGroup(id: $id) {
  585. id
  586. name
  587. customers(options: $options) {
  588. items {
  589. id
  590. }
  591. totalItems
  592. }
  593. }
  594. }
  595. `;
  596. export const ADD_CUSTOMERS_TO_GROUP = gql`
  597. mutation AddCustomersToGroup($groupId: ID!, $customerIds: [ID!]!) {
  598. addCustomersToGroup(customerGroupId: $groupId, customerIds: $customerIds) {
  599. ...CustomerGroup
  600. }
  601. }
  602. ${CUSTOMER_GROUP_FRAGMENT}
  603. `;
  604. export const GET_CUSTOMER_WITH_GROUPS = gql`
  605. query GetCustomerWithGroups($id: ID!) {
  606. customer(id: $id) {
  607. id
  608. groups {
  609. id
  610. name
  611. }
  612. }
  613. }
  614. `;
  615. export const ADMIN_TRANSITION_TO_STATE = gql`
  616. mutation AdminTransition($id: ID!, $state: String!) {
  617. transitionOrderToState(id: $id, state: $state) {
  618. ...Order
  619. ... on OrderStateTransitionError {
  620. errorCode
  621. message
  622. transitionError
  623. fromState
  624. toState
  625. }
  626. }
  627. }
  628. ${ORDER_FRAGMENT}
  629. `;
  630. export const CANCEL_ORDER = gql`
  631. mutation CancelOrder($input: CancelOrderInput!) {
  632. cancelOrder(input: $input) {
  633. ...CanceledOrder
  634. ... on ErrorResult {
  635. errorCode
  636. message
  637. }
  638. }
  639. }
  640. fragment CanceledOrder on Order {
  641. id
  642. lines {
  643. quantity
  644. items {
  645. id
  646. cancelled
  647. }
  648. }
  649. }
  650. `;
  651. export const UPDATE_GLOBAL_SETTINGS = gql`
  652. mutation UpdateGlobalSettings($input: UpdateGlobalSettingsInput!) {
  653. updateGlobalSettings(input: $input) {
  654. ...GlobalSettings
  655. ... on ErrorResult {
  656. errorCode
  657. message
  658. }
  659. }
  660. }
  661. ${GLOBAL_SETTINGS_FRAGMENT}
  662. `;
  663. export const UPDATE_ROLE = gql`
  664. mutation UpdateRole($input: UpdateRoleInput!) {
  665. updateRole(input: $input) {
  666. ...Role
  667. }
  668. }
  669. ${ROLE_FRAGMENT}
  670. `;
  671. export const GET_PRODUCTS_WITH_VARIANT_PRICES = gql`
  672. query GetProductsWithVariantPrices {
  673. products {
  674. items {
  675. id
  676. slug
  677. variants {
  678. id
  679. price
  680. priceWithTax
  681. sku
  682. facetValues {
  683. id
  684. code
  685. }
  686. }
  687. }
  688. }
  689. }
  690. `;
  691. export const CREATE_PRODUCT_OPTION_GROUP = gql`
  692. mutation CreateProductOptionGroup($input: CreateProductOptionGroupInput!) {
  693. createProductOptionGroup(input: $input) {
  694. ...ProductOptionGroup
  695. }
  696. }
  697. ${PRODUCT_OPTION_GROUP_FRAGMENT}
  698. `;
  699. export const ADD_OPTION_GROUP_TO_PRODUCT = gql`
  700. mutation AddOptionGroupToProduct($productId: ID!, $optionGroupId: ID!) {
  701. addOptionGroupToProduct(productId: $productId, optionGroupId: $optionGroupId) {
  702. ...ProductWithOptions
  703. }
  704. }
  705. ${PRODUCT_WITH_OPTIONS_FRAGMENT}
  706. `;
  707. export const CREATE_SHIPPING_METHOD = gql`
  708. mutation CreateShippingMethod($input: CreateShippingMethodInput!) {
  709. createShippingMethod(input: $input) {
  710. ...ShippingMethod
  711. }
  712. }
  713. ${SHIPPING_METHOD_FRAGMENT}
  714. `;
  715. export const SETTLE_PAYMENT = gql`
  716. mutation SettlePayment($id: ID!) {
  717. settlePayment(id: $id) {
  718. ...Payment
  719. ... on ErrorResult {
  720. errorCode
  721. message
  722. }
  723. ... on SettlePaymentError {
  724. paymentErrorMessage
  725. }
  726. }
  727. }
  728. fragment Payment on Payment {
  729. id
  730. state
  731. metadata
  732. }
  733. `;
  734. export const GET_ORDER_HISTORY = gql`
  735. query GetOrderHistory($id: ID!, $options: HistoryEntryListOptions) {
  736. order(id: $id) {
  737. id
  738. history(options: $options) {
  739. totalItems
  740. items {
  741. id
  742. type
  743. administrator {
  744. id
  745. }
  746. data
  747. }
  748. }
  749. }
  750. }
  751. `;
  752. export const UPDATE_SHIPPING_METHOD = gql`
  753. mutation UpdateShippingMethod($input: UpdateShippingMethodInput!) {
  754. updateShippingMethod(input: $input) {
  755. ...ShippingMethod
  756. }
  757. }
  758. ${SHIPPING_METHOD_FRAGMENT}
  759. `;