shared-definitions.ts 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273
  1. import {
  2. administratorFragment,
  3. assetFragment,
  4. canceledOrderFragment,
  5. channelFragment,
  6. collectionFragment,
  7. countryFragment,
  8. currentUserFragment,
  9. customerFragment,
  10. customerGroupFragment,
  11. facetValueFragment,
  12. facetWithValuesFragment,
  13. fulfillmentFragment,
  14. globalSettingsFragment,
  15. orderFragment,
  16. orderWithLinesFragment,
  17. orderWithModificationsFragment,
  18. paymentFragment,
  19. productOptionGroupFragment,
  20. productVariantFragment,
  21. productWithOptionsFragment,
  22. productWithVariantsFragment,
  23. promotionFragment,
  24. refundFragment,
  25. roleFragment,
  26. shippingMethodFragment,
  27. taxRateFragment,
  28. variantWithStockFragment,
  29. zoneFragment,
  30. } from './fragments-admin';
  31. import { graphql } from './graphql-admin';
  32. export const getTasksDocument = graphql(`
  33. query GetTasks {
  34. scheduledTasks {
  35. id
  36. description
  37. schedule
  38. scheduleDescription
  39. lastResult
  40. enabled
  41. }
  42. }
  43. `);
  44. export const updateTaskDocument = graphql(`
  45. mutation UpdateTask($input: UpdateScheduledTaskInput!) {
  46. updateScheduledTask(input: $input) {
  47. id
  48. enabled
  49. }
  50. }
  51. `);
  52. export const runTaskDocument = graphql(`
  53. mutation RunTask($id: String!) {
  54. runScheduledTask(id: $id) {
  55. success
  56. }
  57. }
  58. `);
  59. export const createAdministratorDocument = graphql(
  60. `
  61. mutation CreateAdministrator($input: CreateAdministratorInput!) {
  62. createAdministrator(input: $input) {
  63. ...Administrator
  64. }
  65. }
  66. `,
  67. [administratorFragment],
  68. );
  69. export const getAdministratorsDocument = graphql(
  70. `
  71. query GetAdministrators($options: AdministratorListOptions) {
  72. administrators(options: $options) {
  73. items {
  74. ...Administrator
  75. }
  76. totalItems
  77. }
  78. }
  79. `,
  80. [administratorFragment],
  81. );
  82. export const getAdministratorDocument = graphql(
  83. `
  84. query GetAdministrator($id: ID!) {
  85. administrator(id: $id) {
  86. ...Administrator
  87. }
  88. }
  89. `,
  90. [administratorFragment],
  91. );
  92. export const getActiveAdministratorDocument = graphql(
  93. `
  94. query ActiveAdministrator {
  95. activeAdministrator {
  96. ...Administrator
  97. }
  98. }
  99. `,
  100. [administratorFragment],
  101. );
  102. export const updateAdministratorDocument = graphql(
  103. `
  104. mutation UpdateAdministrator($input: UpdateAdministratorInput!) {
  105. updateAdministrator(input: $input) {
  106. ...Administrator
  107. }
  108. }
  109. `,
  110. [administratorFragment],
  111. );
  112. export const updateActiveAdministratorDocument = graphql(
  113. `
  114. mutation UpdateActiveAdministrator($input: UpdateActiveAdministratorInput!) {
  115. updateActiveAdministrator(input: $input) {
  116. ...Administrator
  117. }
  118. }
  119. `,
  120. [administratorFragment],
  121. );
  122. export const deleteAdministratorDocument = graphql(`
  123. mutation DeleteAdministrator($id: ID!) {
  124. deleteAdministrator(id: $id) {
  125. message
  126. result
  127. }
  128. }
  129. `);
  130. export const updateProductDocument = graphql(
  131. `
  132. mutation UpdateProduct($input: UpdateProductInput!) {
  133. updateProduct(input: $input) {
  134. ...ProductWithVariants
  135. }
  136. }
  137. `,
  138. [productWithVariantsFragment],
  139. );
  140. export const updateProductOptionGroupDocument = graphql(`
  141. mutation UpdateOptionGroup($input: UpdateProductOptionGroupInput!) {
  142. updateProductOptionGroup(input: $input) {
  143. id
  144. }
  145. }
  146. `);
  147. export const createProductDocument = graphql(
  148. `
  149. mutation CreateProduct($input: CreateProductInput!) {
  150. createProduct(input: $input) {
  151. ...ProductWithVariants
  152. }
  153. }
  154. `,
  155. [productWithVariantsFragment],
  156. );
  157. export const getProductWithVariantsDocument = graphql(
  158. `
  159. query GetProductWithVariants($id: ID, $slug: String) {
  160. product(slug: $slug, id: $id) {
  161. ...ProductWithVariants
  162. }
  163. }
  164. `,
  165. [productWithVariantsFragment],
  166. );
  167. export const getProductListDocument = graphql(`
  168. query GetProductList($options: ProductListOptions) {
  169. products(options: $options) {
  170. items {
  171. id
  172. languageCode
  173. name
  174. slug
  175. featuredAsset {
  176. id
  177. preview
  178. }
  179. }
  180. totalItems
  181. }
  182. }
  183. `);
  184. export const getProductWithFacetValuesDocument = graphql(`
  185. query GetProductWithFacetValues($id: ID!) {
  186. product(id: $id) {
  187. id
  188. facetValues {
  189. id
  190. name
  191. code
  192. }
  193. variants {
  194. id
  195. facetValues {
  196. id
  197. name
  198. code
  199. }
  200. }
  201. }
  202. }
  203. `);
  204. export const getProductsListWithVariantsDocument = graphql(`
  205. query GetProductListWithVariants {
  206. products {
  207. items {
  208. id
  209. name
  210. variants {
  211. id
  212. name
  213. }
  214. }
  215. totalItems
  216. }
  217. }
  218. `);
  219. export const createProductVariantsDocument = graphql(
  220. `
  221. mutation CreateProductVariants($input: [CreateProductVariantInput!]!) {
  222. createProductVariants(input: $input) {
  223. ...ProductVariant
  224. }
  225. }
  226. `,
  227. [productVariantFragment],
  228. );
  229. export const updateProductVariantsDocument = graphql(
  230. `
  231. mutation UpdateProductVariants($input: [UpdateProductVariantInput!]!) {
  232. updateProductVariants(input: $input) {
  233. ...ProductVariant
  234. }
  235. }
  236. `,
  237. [productVariantFragment],
  238. );
  239. export const updateTaxRateDocument = graphql(
  240. `
  241. mutation UpdateTaxRate($input: UpdateTaxRateInput!) {
  242. updateTaxRate(input: $input) {
  243. ...TaxRate
  244. }
  245. }
  246. `,
  247. [taxRateFragment],
  248. );
  249. export const createFacetDocument = graphql(
  250. `
  251. mutation CreateFacet($input: CreateFacetInput!) {
  252. createFacet(input: $input) {
  253. ...FacetWithValues
  254. }
  255. }
  256. `,
  257. [facetWithValuesFragment],
  258. );
  259. export const updateFacetDocument = graphql(
  260. `
  261. mutation UpdateFacet($input: UpdateFacetInput!) {
  262. updateFacet(input: $input) {
  263. ...FacetWithValues
  264. }
  265. }
  266. `,
  267. [facetWithValuesFragment],
  268. );
  269. export const createFacetValueDocument = graphql(
  270. `
  271. mutation CreateFacetValue($input: CreateFacetValueInput!) {
  272. createFacetValue(input: $input) {
  273. ...FacetValue
  274. }
  275. }
  276. `,
  277. [facetValueFragment],
  278. );
  279. export const updateFacetValueDocument = graphql(
  280. `
  281. mutation UpdateFacetValue($input: UpdateFacetValueInput!) {
  282. updateFacetValue(input: $input) {
  283. ...FacetValue
  284. }
  285. }
  286. `,
  287. [facetValueFragment],
  288. );
  289. export const createFacetValuesDocument = graphql(
  290. `
  291. mutation CreateFacetValues($input: [CreateFacetValueInput!]!) {
  292. createFacetValues(input: $input) {
  293. ...FacetValue
  294. }
  295. }
  296. `,
  297. [facetValueFragment],
  298. );
  299. export const updateFacetValuesDocument = graphql(
  300. `
  301. mutation UpdateFacetValues($input: [UpdateFacetValueInput!]!) {
  302. updateFacetValues(input: $input) {
  303. ...FacetValue
  304. }
  305. }
  306. `,
  307. [facetValueFragment],
  308. );
  309. export const deleteFacetValuesDocument = graphql(`
  310. mutation DeleteFacetValues($ids: [ID!]!, $force: Boolean) {
  311. deleteFacetValues(ids: $ids, force: $force) {
  312. result
  313. message
  314. }
  315. }
  316. `);
  317. export const deleteFacetDocument = graphql(`
  318. mutation DeleteFacet($id: ID!, $force: Boolean) {
  319. deleteFacet(id: $id, force: $force) {
  320. result
  321. message
  322. }
  323. }
  324. `);
  325. export const getCustomerListDocument = graphql(`
  326. query GetCustomerList($options: CustomerListOptions) {
  327. customers(options: $options) {
  328. items {
  329. id
  330. title
  331. firstName
  332. lastName
  333. emailAddress
  334. phoneNumber
  335. user {
  336. id
  337. identifier
  338. verified
  339. }
  340. }
  341. totalItems
  342. }
  343. }
  344. `);
  345. export const getCustomerIdsDocument = graphql(`
  346. query GetCustomerIds {
  347. customers {
  348. items {
  349. id
  350. }
  351. }
  352. }
  353. `);
  354. export const getAssetListDocument = graphql(
  355. `
  356. query GetAssetList($options: AssetListOptions) {
  357. assets(options: $options) {
  358. items {
  359. ...Asset
  360. }
  361. totalItems
  362. }
  363. }
  364. `,
  365. [assetFragment],
  366. );
  367. export const createRoleDocument = graphql(
  368. `
  369. mutation CreateRole($input: CreateRoleInput!) {
  370. createRole(input: $input) {
  371. ...Role
  372. }
  373. }
  374. `,
  375. [roleFragment],
  376. );
  377. export const createCollectionDocument = graphql(
  378. `
  379. mutation CreateCollection($input: CreateCollectionInput!) {
  380. createCollection(input: $input) {
  381. ...Collection
  382. }
  383. }
  384. `,
  385. [collectionFragment],
  386. );
  387. export const updateCollectionDocument = graphql(
  388. `
  389. mutation UpdateCollection($input: UpdateCollectionInput!) {
  390. updateCollection(input: $input) {
  391. ...Collection
  392. }
  393. }
  394. `,
  395. [collectionFragment],
  396. );
  397. export const getCustomerDocument = graphql(
  398. `
  399. query GetCustomer($id: ID!, $orderListOptions: OrderListOptions) {
  400. customer(id: $id) {
  401. ...Customer
  402. orders(options: $orderListOptions) {
  403. items {
  404. id
  405. code
  406. state
  407. total
  408. currencyCode
  409. updatedAt
  410. }
  411. totalItems
  412. }
  413. }
  414. }
  415. `,
  416. [customerFragment],
  417. );
  418. export const attemptLoginDocument = graphql(
  419. `
  420. mutation AttemptLogin($username: String!, $password: String!, $rememberMe: Boolean) {
  421. login(username: $username, password: $password, rememberMe: $rememberMe) {
  422. ...CurrentUser
  423. ... on ErrorResult {
  424. errorCode
  425. message
  426. }
  427. }
  428. }
  429. `,
  430. [currentUserFragment],
  431. );
  432. export const logoutDocument = graphql(`
  433. mutation Logout {
  434. logout {
  435. success
  436. }
  437. }
  438. `);
  439. export const getCountryListDocument = graphql(`
  440. query GetCountryList($options: CountryListOptions) {
  441. countries(options: $options) {
  442. items {
  443. id
  444. code
  445. name
  446. enabled
  447. }
  448. totalItems
  449. }
  450. }
  451. `);
  452. export const updateCountryDocument = graphql(
  453. `
  454. mutation UpdateCountry($input: UpdateCountryInput!) {
  455. updateCountry(input: $input) {
  456. ...Country
  457. }
  458. }
  459. `,
  460. [countryFragment],
  461. );
  462. export const getGlobalSettingsDocument = graphql(
  463. `
  464. query GetGlobalSettings {
  465. globalSettings {
  466. ...GlobalSettings
  467. }
  468. }
  469. `,
  470. [globalSettingsFragment],
  471. );
  472. export const getFacetListDocument = graphql(
  473. `
  474. query GetFacetList($options: FacetListOptions) {
  475. facets(options: $options) {
  476. items {
  477. ...FacetWithValues
  478. }
  479. totalItems
  480. }
  481. }
  482. `,
  483. [facetWithValuesFragment],
  484. );
  485. export const getFacetListSimpleDocument = graphql(`
  486. query GetFacetListSimple($options: FacetListOptions) {
  487. facets(options: $options) {
  488. items {
  489. id
  490. name
  491. }
  492. totalItems
  493. }
  494. }
  495. `);
  496. export const deleteProductDocument = graphql(`
  497. mutation DeleteProduct($id: ID!) {
  498. deleteProduct(id: $id) {
  499. result
  500. }
  501. }
  502. `);
  503. export const getProductSimpleDocument = graphql(`
  504. query GetProductSimple($id: ID, $slug: String) {
  505. product(slug: $slug, id: $id) {
  506. id
  507. slug
  508. }
  509. }
  510. `);
  511. export const getProductIdNameDocument = graphql(`
  512. query GetProductIdName($id: ID!) {
  513. product(id: $id) {
  514. id
  515. name
  516. }
  517. }
  518. `);
  519. export const getStockMovementDocument = graphql(
  520. `
  521. query GetStockMovement($id: ID!) {
  522. product(id: $id) {
  523. id
  524. variants {
  525. ...VariantWithStock
  526. }
  527. }
  528. }
  529. `,
  530. [variantWithStockFragment],
  531. );
  532. export const getStockMovementByTypeDocument = graphql(`
  533. query GetStockMovementByType($id: ID!, $type: StockMovementType!) {
  534. product(id: $id) {
  535. id
  536. variants {
  537. stockMovements(options: { type: $type }) {
  538. items {
  539. ... on StockMovement {
  540. id
  541. type
  542. quantity
  543. }
  544. }
  545. totalItems
  546. }
  547. }
  548. }
  549. }
  550. `);
  551. export const getRunningJobsDocument = graphql(`
  552. query GetRunningJobs($options: JobListOptions) {
  553. jobs(options: $options) {
  554. items {
  555. id
  556. queueName
  557. state
  558. isSettled
  559. duration
  560. }
  561. totalItems
  562. }
  563. }
  564. `);
  565. export const cancelJobDocument = graphql(`
  566. mutation CancelJob($id: ID!) {
  567. cancelJob(jobId: $id) {
  568. id
  569. state
  570. isSettled
  571. settledAt
  572. }
  573. }
  574. `);
  575. export const createPromotionDocument = graphql(
  576. `
  577. mutation CreatePromotion($input: CreatePromotionInput!) {
  578. createPromotion(input: $input) {
  579. ...Promotion
  580. ... on ErrorResult {
  581. errorCode
  582. message
  583. }
  584. }
  585. }
  586. `,
  587. [promotionFragment],
  588. );
  589. export const MeDocument = graphql(
  590. `
  591. query Me {
  592. me {
  593. ...CurrentUser
  594. }
  595. }
  596. `,
  597. [currentUserFragment],
  598. );
  599. export const createChannelDocument = graphql(
  600. `
  601. mutation CreateChannel($input: CreateChannelInput!) {
  602. createChannel(input: $input) {
  603. ...Channel
  604. ... on LanguageNotAvailableError {
  605. errorCode
  606. message
  607. languageCode
  608. }
  609. }
  610. }
  611. `,
  612. [channelFragment],
  613. );
  614. export const deleteProductVariantDocument = graphql(`
  615. mutation DeleteProductVariant($id: ID!) {
  616. deleteProductVariant(id: $id) {
  617. result
  618. message
  619. }
  620. }
  621. `);
  622. export const assignProductToChannelDocument = graphql(
  623. `
  624. mutation AssignProductsToChannel($input: AssignProductsToChannelInput!) {
  625. assignProductsToChannel(input: $input) {
  626. ...ProductWithVariants
  627. }
  628. }
  629. `,
  630. [productWithVariantsFragment],
  631. );
  632. export const removeProductFromChannelDocument = graphql(
  633. `
  634. mutation RemoveProductsFromChannel($input: RemoveProductsFromChannelInput!) {
  635. removeProductsFromChannel(input: $input) {
  636. ...ProductWithVariants
  637. }
  638. }
  639. `,
  640. [productWithVariantsFragment],
  641. );
  642. export const assignProductVariantToChannelDocument = graphql(
  643. `
  644. mutation AssignProductVariantsToChannel($input: AssignProductVariantsToChannelInput!) {
  645. assignProductVariantsToChannel(input: $input) {
  646. ...ProductVariant
  647. }
  648. }
  649. `,
  650. [productVariantFragment],
  651. );
  652. export const removeProductVariantFromChannelDocument = graphql(
  653. `
  654. mutation RemoveProductVariantsFromChannel($input: RemoveProductVariantsFromChannelInput!) {
  655. removeProductVariantsFromChannel(input: $input) {
  656. ...ProductVariant
  657. }
  658. }
  659. `,
  660. [productVariantFragment],
  661. );
  662. export const assignFacetsToChannelDocument = graphql(`
  663. mutation AssignFacetsToChannel($input: AssignFacetsToChannelInput!) {
  664. assignFacetsToChannel(input: $input) {
  665. id
  666. name
  667. }
  668. }
  669. `);
  670. export const removeFacetsFromChannelDocument = graphql(`
  671. mutation RemoveFacetsFromChannel($input: RemoveFacetsFromChannelInput!) {
  672. removeFacetsFromChannel(input: $input) {
  673. ... on Facet {
  674. id
  675. name
  676. }
  677. ... on FacetInUseError {
  678. errorCode
  679. message
  680. productCount
  681. variantCount
  682. }
  683. }
  684. }
  685. `);
  686. export const getEntityDuplicatorsDocument = graphql(`
  687. query GetEntityDuplicators {
  688. entityDuplicators {
  689. code
  690. description
  691. requiresPermission
  692. forEntities
  693. args {
  694. name
  695. type
  696. defaultValue
  697. }
  698. }
  699. }
  700. `);
  701. export const duplicateEntityDocument = graphql(`
  702. mutation DuplicateEntity($input: DuplicateEntityInput!) {
  703. duplicateEntity(input: $input) {
  704. ... on DuplicateEntitySuccess {
  705. newEntityId
  706. }
  707. ... on DuplicateEntityError {
  708. errorCode
  709. message
  710. duplicationError
  711. }
  712. }
  713. }
  714. `);
  715. export const updateAssetDocument = graphql(
  716. `
  717. mutation UpdateAsset($input: UpdateAssetInput!) {
  718. updateAsset(input: $input) {
  719. ...Asset
  720. ... on Asset {
  721. tags {
  722. id
  723. value
  724. }
  725. focalPoint {
  726. x
  727. y
  728. }
  729. }
  730. }
  731. }
  732. `,
  733. [assetFragment],
  734. );
  735. export const deleteAssetDocument = graphql(`
  736. mutation DeleteAsset($input: DeleteAssetInput!) {
  737. deleteAsset(input: $input) {
  738. result
  739. message
  740. }
  741. }
  742. `);
  743. export const updateChannelDocument = graphql(
  744. `
  745. mutation UpdateChannel($input: UpdateChannelInput!) {
  746. updateChannel(input: $input) {
  747. ...Channel
  748. ... on LanguageNotAvailableError {
  749. errorCode
  750. message
  751. languageCode
  752. }
  753. }
  754. }
  755. `,
  756. [channelFragment],
  757. );
  758. export const getCustomerHistoryDocument = graphql(`
  759. query GetCustomerHistory($id: ID!, $options: HistoryEntryListOptions) {
  760. customer(id: $id) {
  761. id
  762. history(options: $options) {
  763. totalItems
  764. items {
  765. id
  766. administrator {
  767. id
  768. }
  769. type
  770. data
  771. }
  772. }
  773. }
  774. }
  775. `);
  776. export const getOrderDocument = graphql(
  777. `
  778. query GetOrder($id: ID!) {
  779. order(id: $id) {
  780. ...OrderWithLines
  781. }
  782. }
  783. `,
  784. [orderWithLinesFragment],
  785. );
  786. export const createCustomerGroupDocument = graphql(
  787. `
  788. mutation CreateCustomerGroup($input: CreateCustomerGroupInput!) {
  789. createCustomerGroup(input: $input) {
  790. ...CustomerGroup
  791. }
  792. }
  793. `,
  794. [customerGroupFragment],
  795. );
  796. export const removeCustomersFromGroupDocument = graphql(
  797. `
  798. mutation RemoveCustomersFromGroup($groupId: ID!, $customerIds: [ID!]!) {
  799. removeCustomersFromGroup(customerGroupId: $groupId, customerIds: $customerIds) {
  800. ...CustomerGroup
  801. }
  802. }
  803. `,
  804. [customerGroupFragment],
  805. );
  806. export const createFulfillmentDocument = graphql(
  807. `
  808. mutation CreateFulfillment($input: FulfillOrderInput!) {
  809. addFulfillmentToOrder(input: $input) {
  810. ...Fulfillment
  811. ... on ErrorResult {
  812. errorCode
  813. message
  814. }
  815. ... on CreateFulfillmentError {
  816. fulfillmentHandlerError
  817. }
  818. }
  819. }
  820. `,
  821. [fulfillmentFragment],
  822. );
  823. export const transitFulfillmentDocument = graphql(
  824. `
  825. mutation TransitFulfillment($id: ID!, $state: String!) {
  826. transitionFulfillmentToState(id: $id, state: $state) {
  827. ...Fulfillment
  828. ... on FulfillmentStateTransitionError {
  829. errorCode
  830. message
  831. transitionError
  832. fromState
  833. toState
  834. }
  835. }
  836. }
  837. `,
  838. [fulfillmentFragment],
  839. );
  840. export const getOrderFulfillmentsDocument = graphql(`
  841. query GetOrderFulfillments($id: ID!) {
  842. order(id: $id) {
  843. id
  844. state
  845. fulfillments {
  846. id
  847. state
  848. nextStates
  849. method
  850. summary {
  851. orderLine {
  852. id
  853. }
  854. quantity
  855. }
  856. }
  857. }
  858. }
  859. `);
  860. export const getOrdersListDocument = graphql(
  861. `
  862. query GetOrderListFull($options: OrderListOptions) {
  863. orders(options: $options) {
  864. items {
  865. ...Order
  866. }
  867. totalItems
  868. }
  869. }
  870. `,
  871. [orderFragment],
  872. );
  873. export const createAddressDocument = graphql(`
  874. mutation CreateAddress($id: ID!, $input: CreateAddressInput!) {
  875. createCustomerAddress(customerId: $id, input: $input) {
  876. id
  877. fullName
  878. company
  879. streetLine1
  880. streetLine2
  881. city
  882. province
  883. postalCode
  884. country {
  885. code
  886. name
  887. }
  888. phoneNumber
  889. defaultShippingAddress
  890. defaultBillingAddress
  891. }
  892. }
  893. `);
  894. export const updateAddressDocument = graphql(`
  895. mutation UpdateAddress($input: UpdateAddressInput!) {
  896. updateCustomerAddress(input: $input) {
  897. id
  898. defaultShippingAddress
  899. defaultBillingAddress
  900. country {
  901. code
  902. name
  903. }
  904. }
  905. }
  906. `);
  907. export const createCustomerDocument = graphql(
  908. `
  909. mutation CreateCustomer($input: CreateCustomerInput!, $password: String) {
  910. createCustomer(input: $input, password: $password) {
  911. ...Customer
  912. ... on ErrorResult {
  913. errorCode
  914. message
  915. }
  916. }
  917. }
  918. `,
  919. [customerFragment],
  920. );
  921. export const updateCustomerDocument = graphql(
  922. `
  923. mutation UpdateCustomer($input: UpdateCustomerInput!) {
  924. updateCustomer(input: $input) {
  925. ...Customer
  926. ... on ErrorResult {
  927. errorCode
  928. message
  929. }
  930. }
  931. }
  932. `,
  933. [customerFragment],
  934. );
  935. export const deleteCustomerDocument = graphql(`
  936. mutation DeleteCustomer($id: ID!) {
  937. deleteCustomer(id: $id) {
  938. result
  939. }
  940. }
  941. `);
  942. export const updateCustomerNoteDocument = graphql(`
  943. mutation UpdateCustomerNote($input: UpdateCustomerNoteInput!) {
  944. updateCustomerNote(input: $input) {
  945. id
  946. data
  947. isPublic
  948. }
  949. }
  950. `);
  951. export const deleteCustomerNoteDocument = graphql(`
  952. mutation DeleteCustomerNote($id: ID!) {
  953. deleteCustomerNote(id: $id) {
  954. result
  955. message
  956. }
  957. }
  958. `);
  959. export const updateCustomerGroupDocument = graphql(
  960. `
  961. mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) {
  962. updateCustomerGroup(input: $input) {
  963. ...CustomerGroup
  964. }
  965. }
  966. `,
  967. [customerGroupFragment],
  968. );
  969. export const deleteCustomerGroupDocument = graphql(`
  970. mutation DeleteCustomerGroup($id: ID!) {
  971. deleteCustomerGroup(id: $id) {
  972. result
  973. message
  974. }
  975. }
  976. `);
  977. export const getCustomerGroupsDocument = graphql(`
  978. query GetCustomerGroups($options: CustomerGroupListOptions) {
  979. customerGroups(options: $options) {
  980. items {
  981. id
  982. name
  983. }
  984. totalItems
  985. }
  986. }
  987. `);
  988. export const getCustomerGroupDocument = graphql(`
  989. query GetCustomerGroup($id: ID!, $options: CustomerListOptions) {
  990. customerGroup(id: $id) {
  991. id
  992. name
  993. customers(options: $options) {
  994. items {
  995. id
  996. }
  997. totalItems
  998. }
  999. }
  1000. }
  1001. `);
  1002. export const addCustomersToGroupDocument = graphql(
  1003. `
  1004. mutation AddCustomersToGroup($groupId: ID!, $customerIds: [ID!]!) {
  1005. addCustomersToGroup(customerGroupId: $groupId, customerIds: $customerIds) {
  1006. ...CustomerGroup
  1007. }
  1008. }
  1009. `,
  1010. [customerGroupFragment],
  1011. );
  1012. export const getCustomerWithGroupsDocument = graphql(`
  1013. query GetCustomerWithGroups($id: ID!) {
  1014. customer(id: $id) {
  1015. id
  1016. groups {
  1017. id
  1018. name
  1019. }
  1020. }
  1021. }
  1022. `);
  1023. export const adminTransitionToStateDocument = graphql(
  1024. `
  1025. mutation AdminTransition($id: ID!, $state: String!) {
  1026. transitionOrderToState(id: $id, state: $state) {
  1027. ...Order
  1028. ... on OrderStateTransitionError {
  1029. errorCode
  1030. message
  1031. transitionError
  1032. fromState
  1033. toState
  1034. }
  1035. }
  1036. }
  1037. `,
  1038. [orderFragment],
  1039. );
  1040. export const cancelOrderDocument = graphql(
  1041. `
  1042. mutation CancelOrder($input: CancelOrderInput!) {
  1043. cancelOrder(input: $input) {
  1044. ...CanceledOrder
  1045. ... on ErrorResult {
  1046. errorCode
  1047. message
  1048. }
  1049. }
  1050. }
  1051. `,
  1052. [canceledOrderFragment],
  1053. );
  1054. export const updateGlobalSettingsDocument = graphql(
  1055. `
  1056. mutation UpdateGlobalSettings($input: UpdateGlobalSettingsInput!) {
  1057. updateGlobalSettings(input: $input) {
  1058. ...GlobalSettings
  1059. ... on ErrorResult {
  1060. errorCode
  1061. message
  1062. }
  1063. }
  1064. }
  1065. `,
  1066. [globalSettingsFragment],
  1067. );
  1068. export const updateRoleDocument = graphql(
  1069. `
  1070. mutation UpdateRole($input: UpdateRoleInput!) {
  1071. updateRole(input: $input) {
  1072. ...Role
  1073. }
  1074. }
  1075. `,
  1076. [roleFragment],
  1077. );
  1078. export const getProductsWithVariantPricesDocument = graphql(`
  1079. query GetProductsWithVariantPrices {
  1080. products {
  1081. items {
  1082. id
  1083. slug
  1084. variants {
  1085. id
  1086. price
  1087. priceWithTax
  1088. currencyCode
  1089. sku
  1090. facetValues {
  1091. id
  1092. code
  1093. }
  1094. }
  1095. }
  1096. }
  1097. }
  1098. `);
  1099. export const createProductOptionGroupDocument = graphql(
  1100. `
  1101. mutation CreateProductOptionGroup($input: CreateProductOptionGroupInput!) {
  1102. createProductOptionGroup(input: $input) {
  1103. ...ProductOptionGroup
  1104. }
  1105. }
  1106. `,
  1107. [productOptionGroupFragment],
  1108. );
  1109. export const addOptionGroupToProductDocument = graphql(
  1110. `
  1111. mutation AddOptionGroupToProduct($productId: ID!, $optionGroupId: ID!) {
  1112. addOptionGroupToProduct(productId: $productId, optionGroupId: $optionGroupId) {
  1113. ...ProductWithOptions
  1114. }
  1115. }
  1116. `,
  1117. [productWithOptionsFragment],
  1118. );
  1119. export const removeOptionGroupFromProductDocument = graphql(
  1120. `
  1121. mutation RemoveOptionGroupFromProduct($productId: ID!, $optionGroupId: ID!, $force: Boolean) {
  1122. removeOptionGroupFromProduct(
  1123. productId: $productId
  1124. optionGroupId: $optionGroupId
  1125. force: $force
  1126. ) {
  1127. ...ProductWithOptions
  1128. ... on ProductOptionInUseError {
  1129. errorCode
  1130. message
  1131. optionGroupCode
  1132. productVariantCount
  1133. }
  1134. }
  1135. }
  1136. `,
  1137. [productWithOptionsFragment],
  1138. );
  1139. export const getOptionGroupDocument = graphql(`
  1140. query GetOptionGroup($id: ID!) {
  1141. productOptionGroup(id: $id) {
  1142. id
  1143. code
  1144. options {
  1145. id
  1146. code
  1147. }
  1148. }
  1149. }
  1150. `);
  1151. export const getProductVariantDocument = graphql(`
  1152. query GetProductVariant($id: ID!) {
  1153. productVariant(id: $id) {
  1154. id
  1155. name
  1156. }
  1157. }
  1158. `);
  1159. export const getProductWithVariantListDocument = graphql(
  1160. `
  1161. query GetProductWithVariantList($id: ID, $variantListOptions: ProductVariantListOptions) {
  1162. product(id: $id) {
  1163. id
  1164. variantList(options: $variantListOptions) {
  1165. items {
  1166. ...ProductVariant
  1167. }
  1168. totalItems
  1169. }
  1170. }
  1171. }
  1172. `,
  1173. [productVariantFragment],
  1174. );
  1175. export const createShippingMethodDocument = graphql(
  1176. `
  1177. mutation CreateShippingMethod($input: CreateShippingMethodInput!) {
  1178. createShippingMethod(input: $input) {
  1179. ...ShippingMethod
  1180. }
  1181. }
  1182. `,
  1183. [shippingMethodFragment],
  1184. );
  1185. export const settlePaymentDocument = graphql(
  1186. `
  1187. mutation SettlePayment($id: ID!) {
  1188. settlePayment(id: $id) {
  1189. ...Payment
  1190. ... on ErrorResult {
  1191. errorCode
  1192. message
  1193. }
  1194. ... on SettlePaymentError {
  1195. paymentErrorMessage
  1196. }
  1197. }
  1198. }
  1199. `,
  1200. [paymentFragment],
  1201. );
  1202. export const getOrderHistoryDocument = graphql(`
  1203. query GetOrderHistory($id: ID!, $options: HistoryEntryListOptions) {
  1204. order(id: $id) {
  1205. id
  1206. history(options: $options) {
  1207. totalItems
  1208. items {
  1209. id
  1210. type
  1211. administrator {
  1212. id
  1213. }
  1214. data
  1215. }
  1216. }
  1217. }
  1218. }
  1219. `);
  1220. export const updateShippingMethodDocument = graphql(
  1221. `
  1222. mutation UpdateShippingMethod($input: UpdateShippingMethodInput!) {
  1223. updateShippingMethod(input: $input) {
  1224. ...ShippingMethod
  1225. }
  1226. }
  1227. `,
  1228. [shippingMethodFragment],
  1229. );
  1230. export const getAssetDocument = graphql(
  1231. `
  1232. query GetAsset($id: ID!) {
  1233. asset(id: $id) {
  1234. ...Asset
  1235. width
  1236. height
  1237. }
  1238. }
  1239. `,
  1240. [assetFragment],
  1241. );
  1242. export const getAssetFragmentFirstDocument = graphql(`
  1243. fragment AssetFragFirst on Asset {
  1244. id
  1245. preview
  1246. }
  1247. query GetAssetFragmentFirst($id: ID!) {
  1248. asset(id: $id) {
  1249. ...AssetFragFirst
  1250. }
  1251. }
  1252. `);
  1253. export const assetWithTagsAndFocalPointFragmentDocument = graphql(
  1254. `
  1255. fragment AssetWithTagsAndFocalPoint on Asset {
  1256. ...Asset
  1257. focalPoint {
  1258. x
  1259. y
  1260. }
  1261. tags {
  1262. id
  1263. value
  1264. }
  1265. }
  1266. `,
  1267. [assetFragment],
  1268. );
  1269. export const createAssetsDocument = graphql(
  1270. `
  1271. mutation CreateAssets($input: [CreateAssetInput!]!) {
  1272. createAssets(input: $input) {
  1273. ...AssetWithTagsAndFocalPoint
  1274. ... on MimeTypeError {
  1275. message
  1276. fileName
  1277. mimeType
  1278. }
  1279. }
  1280. }
  1281. `,
  1282. [assetWithTagsAndFocalPointFragmentDocument],
  1283. );
  1284. export const deleteShippingMethodDocument = graphql(`
  1285. mutation DeleteShippingMethod($id: ID!) {
  1286. deleteShippingMethod(id: $id) {
  1287. result
  1288. message
  1289. }
  1290. }
  1291. `);
  1292. export const assignPromotionsToChannelDocument = graphql(`
  1293. mutation AssignPromotionToChannel($input: AssignPromotionsToChannelInput!) {
  1294. assignPromotionsToChannel(input: $input) {
  1295. id
  1296. name
  1297. }
  1298. }
  1299. `);
  1300. export const removePromotionsFromChannelDocument = graphql(`
  1301. mutation RemovePromotionFromChannel($input: RemovePromotionsFromChannelInput!) {
  1302. removePromotionsFromChannel(input: $input) {
  1303. id
  1304. name
  1305. }
  1306. }
  1307. `);
  1308. export const getTaxRateDocument = graphql(
  1309. `
  1310. query GetTaxRate($id: ID!) {
  1311. taxRate(id: $id) {
  1312. ...TaxRate
  1313. }
  1314. }
  1315. `,
  1316. [taxRateFragment],
  1317. );
  1318. export const createTaxRateDocument = graphql(
  1319. `
  1320. mutation CreateTaxRate($input: CreateTaxRateInput!) {
  1321. createTaxRate(input: $input) {
  1322. ...TaxRate
  1323. }
  1324. }
  1325. `,
  1326. [taxRateFragment],
  1327. );
  1328. export const deleteTaxRateDocument = graphql(`
  1329. mutation DeleteTaxRate($id: ID!) {
  1330. deleteTaxRate(id: $id) {
  1331. result
  1332. message
  1333. }
  1334. }
  1335. `);
  1336. export const getTaxRatesListDocument = graphql(
  1337. `
  1338. query GetTaxRates($options: TaxRateListOptions) {
  1339. taxRates(options: $options) {
  1340. items {
  1341. ...TaxRate
  1342. }
  1343. totalItems
  1344. }
  1345. }
  1346. `,
  1347. [taxRateFragment],
  1348. );
  1349. export const getShippingMethodListDocument = graphql(
  1350. `
  1351. query GetShippingMethodList {
  1352. shippingMethods {
  1353. items {
  1354. ...ShippingMethod
  1355. }
  1356. totalItems
  1357. }
  1358. }
  1359. `,
  1360. [shippingMethodFragment],
  1361. );
  1362. export const getCollectionsDocument = graphql(`
  1363. query GetCollections {
  1364. collections {
  1365. items {
  1366. id
  1367. name
  1368. position
  1369. parent {
  1370. id
  1371. name
  1372. }
  1373. }
  1374. }
  1375. }
  1376. `);
  1377. export const transitionPaymentToStateDocument = graphql(
  1378. `
  1379. mutation TransitionPaymentToState($id: ID!, $state: String!) {
  1380. transitionPaymentToState(id: $id, state: $state) {
  1381. ...Payment
  1382. ... on ErrorResult {
  1383. errorCode
  1384. message
  1385. }
  1386. ... on PaymentStateTransitionError {
  1387. transitionError
  1388. }
  1389. }
  1390. }
  1391. `,
  1392. [paymentFragment],
  1393. );
  1394. export const getProductVariantListDocument = graphql(`
  1395. query GetProductVariantList($options: ProductVariantListOptions, $productId: ID) {
  1396. productVariants(options: $options, productId: $productId) {
  1397. items {
  1398. id
  1399. name
  1400. sku
  1401. price
  1402. priceWithTax
  1403. currencyCode
  1404. prices {
  1405. currencyCode
  1406. price
  1407. }
  1408. }
  1409. totalItems
  1410. }
  1411. }
  1412. `);
  1413. export const deletePromotionDocument = graphql(`
  1414. mutation DeletePromotion($id: ID!) {
  1415. deletePromotion(id: $id) {
  1416. result
  1417. }
  1418. }
  1419. `);
  1420. export const getChannelsDocument = graphql(`
  1421. query GetChannels {
  1422. channels {
  1423. items {
  1424. id
  1425. code
  1426. token
  1427. }
  1428. }
  1429. }
  1430. `);
  1431. export const assignCollectionsToChannelDocument = graphql(
  1432. `
  1433. mutation AssignCollectionsToChannel($input: AssignCollectionsToChannelInput!) {
  1434. assignCollectionsToChannel(input: $input) {
  1435. ...Collection
  1436. }
  1437. }
  1438. `,
  1439. [collectionFragment],
  1440. );
  1441. export const getCollectionDocument = graphql(
  1442. `
  1443. query GetCollection($id: ID, $slug: String, $variantListOptions: ProductVariantListOptions) {
  1444. collection(id: $id, slug: $slug) {
  1445. ...Collection
  1446. productVariants(options: $variantListOptions) {
  1447. items {
  1448. id
  1449. name
  1450. price
  1451. }
  1452. }
  1453. }
  1454. }
  1455. `,
  1456. [collectionFragment],
  1457. );
  1458. export const getFacetWithValuesDocument = graphql(
  1459. `
  1460. query GetFacetWithValues($id: ID!) {
  1461. facet(id: $id) {
  1462. ...FacetWithValues
  1463. }
  1464. }
  1465. `,
  1466. [facetWithValuesFragment],
  1467. );
  1468. export const getFacetWithValueListDocument = graphql(
  1469. `
  1470. query GetFacetWithValueList($id: ID!, $options: FacetValueListOptions) {
  1471. facet(id: $id) {
  1472. id
  1473. languageCode
  1474. isPrivate
  1475. code
  1476. name
  1477. valueList(options: $options) {
  1478. items {
  1479. ...FacetValue
  1480. }
  1481. totalItems
  1482. }
  1483. }
  1484. }
  1485. `,
  1486. [facetValueFragment],
  1487. );
  1488. export const getFacetValuesDocument = graphql(
  1489. `
  1490. query GetFacetValues($options: FacetValueListOptions) {
  1491. facetValues(options: $options) {
  1492. items {
  1493. ...FacetValue
  1494. }
  1495. totalItems
  1496. }
  1497. }
  1498. `,
  1499. [facetValueFragment],
  1500. );
  1501. export const getFacetValueDocument = graphql(
  1502. `
  1503. query GetFacetValue($id: ID!) {
  1504. facetValue(id: $id) {
  1505. ...FacetValue
  1506. }
  1507. }
  1508. `,
  1509. [facetValueFragment],
  1510. );
  1511. export const getPromotionDocument = graphql(
  1512. `
  1513. query GetPromotion($id: ID!) {
  1514. promotion(id: $id) {
  1515. ...Promotion
  1516. }
  1517. }
  1518. `,
  1519. [promotionFragment],
  1520. );
  1521. export const getOrderListDocument = graphql(`
  1522. query GetOrderList($options: OrderListOptions) {
  1523. orders(options: $options) {
  1524. items {
  1525. id
  1526. code
  1527. state
  1528. total
  1529. totalWithTax
  1530. totalQuantity
  1531. customer {
  1532. id
  1533. emailAddress
  1534. lastName
  1535. }
  1536. }
  1537. totalItems
  1538. }
  1539. }
  1540. `);
  1541. export const getOrderWithPaymentsDocument = graphql(`
  1542. query GetOrderWithPayments($id: ID!) {
  1543. order(id: $id) {
  1544. id
  1545. payments {
  1546. id
  1547. errorMessage
  1548. metadata
  1549. refunds {
  1550. id
  1551. total
  1552. }
  1553. }
  1554. }
  1555. }
  1556. `);
  1557. export const getOrderWithRefundLinesDocument = graphql(`
  1558. query GetOrderWithRefundLines($id: ID!) {
  1559. order(id: $id) {
  1560. id
  1561. lines {
  1562. id
  1563. quantity
  1564. orderPlacedQuantity
  1565. }
  1566. payments {
  1567. id
  1568. method
  1569. refunds {
  1570. id
  1571. total
  1572. lines {
  1573. orderLineId
  1574. quantity
  1575. }
  1576. }
  1577. }
  1578. }
  1579. }
  1580. `);
  1581. export const getOrderListWithQtyDocument = graphql(`
  1582. query GetOrderListWithQty($options: OrderListOptions) {
  1583. orders(options: $options) {
  1584. items {
  1585. id
  1586. code
  1587. totalQuantity
  1588. lines {
  1589. id
  1590. quantity
  1591. }
  1592. }
  1593. }
  1594. }
  1595. `);
  1596. export const refundOrderDocument = graphql(
  1597. `
  1598. mutation RefundOrder($input: RefundOrderInput!) {
  1599. refundOrder(input: $input) {
  1600. ...Refund
  1601. ... on ErrorResult {
  1602. errorCode
  1603. message
  1604. }
  1605. }
  1606. }
  1607. `,
  1608. [refundFragment],
  1609. );
  1610. export const settleRefundDocument = graphql(
  1611. `
  1612. mutation SettleRefund($input: SettleRefundInput!) {
  1613. settleRefund(input: $input) {
  1614. ...Refund
  1615. ... on ErrorResult {
  1616. errorCode
  1617. message
  1618. }
  1619. }
  1620. }
  1621. `,
  1622. [refundFragment],
  1623. );
  1624. export const addNoteToOrderDocument = graphql(`
  1625. mutation AddNoteToOrder($input: AddNoteToOrderInput!) {
  1626. addNoteToOrder(input: $input) {
  1627. id
  1628. }
  1629. }
  1630. `);
  1631. export const updateOrderNoteDocument = graphql(`
  1632. mutation UpdateOrderNote($input: UpdateOrderNoteInput!) {
  1633. updateOrderNote(input: $input) {
  1634. id
  1635. data
  1636. isPublic
  1637. }
  1638. }
  1639. `);
  1640. export const deleteOrderNoteDocument = graphql(`
  1641. mutation DeleteOrderNote($id: ID!) {
  1642. deleteOrderNote(id: $id) {
  1643. result
  1644. message
  1645. }
  1646. }
  1647. `);
  1648. export const getOrderLineFulfillmentsDocument = graphql(`
  1649. query GetOrderLineFulfillments($id: ID!) {
  1650. order(id: $id) {
  1651. id
  1652. lines {
  1653. id
  1654. fulfillmentLines {
  1655. fulfillment {
  1656. id
  1657. state
  1658. }
  1659. orderLineId
  1660. quantity
  1661. }
  1662. }
  1663. }
  1664. }
  1665. `);
  1666. export const getOrderListFulfillmentsDocument = graphql(`
  1667. query GetOrderListFulfillments {
  1668. orders {
  1669. items {
  1670. id
  1671. state
  1672. fulfillments {
  1673. id
  1674. state
  1675. nextStates
  1676. method
  1677. }
  1678. }
  1679. }
  1680. }
  1681. `);
  1682. export const cancelPaymentDocument = graphql(
  1683. `
  1684. mutation CancelPayment($paymentId: ID!) {
  1685. cancelPayment(id: $paymentId) {
  1686. ...Payment
  1687. ... on ErrorResult {
  1688. errorCode
  1689. message
  1690. }
  1691. ... on PaymentStateTransitionError {
  1692. transitionError
  1693. }
  1694. ... on CancelPaymentError {
  1695. paymentErrorMessage
  1696. }
  1697. }
  1698. }
  1699. `,
  1700. [paymentFragment],
  1701. );
  1702. export const setOrderCustomerDocument = graphql(`
  1703. mutation SetOrderCustomer($input: SetOrderCustomerInput!) {
  1704. setOrderCustomer(input: $input) {
  1705. id
  1706. customer {
  1707. id
  1708. }
  1709. }
  1710. }
  1711. `);
  1712. export const getOrderAssetEdgeCaseDocument = graphql(`
  1713. query OrderAssetEdgeCase($id: ID!) {
  1714. order(id: $id) {
  1715. lines {
  1716. id
  1717. }
  1718. id
  1719. lines {
  1720. id
  1721. featuredAsset {
  1722. preview
  1723. }
  1724. }
  1725. }
  1726. }
  1727. `);
  1728. export const getOrderWithLineCalculatedPropsDocument = graphql(`
  1729. query GetOrderWithLineCalculatedProps($id: ID!) {
  1730. order(id: $id) {
  1731. id
  1732. lines {
  1733. id
  1734. linePriceWithTax
  1735. quantity
  1736. }
  1737. }
  1738. }
  1739. `);
  1740. export const addManualPaymentDocument = graphql(`
  1741. mutation AddManualPaymentToOrder($input: ManualPaymentInput!) {
  1742. addManualPaymentToOrder(input: $input) {
  1743. ... on Order {
  1744. id
  1745. code
  1746. state
  1747. active
  1748. total
  1749. totalWithTax
  1750. lines {
  1751. id
  1752. }
  1753. payments {
  1754. id
  1755. state
  1756. }
  1757. }
  1758. ... on ErrorResult {
  1759. errorCode
  1760. message
  1761. }
  1762. }
  1763. }
  1764. `);
  1765. export const modifyOrderDocument = graphql(
  1766. `
  1767. mutation ModifyOrder($input: ModifyOrderInput!) {
  1768. modifyOrder(input: $input) {
  1769. ...OrderWithModifications
  1770. ... on ErrorResult {
  1771. errorCode
  1772. message
  1773. }
  1774. }
  1775. }
  1776. `,
  1777. [orderWithModificationsFragment],
  1778. );
  1779. export const addManualPaymentToOrderDocument = graphql(
  1780. `
  1781. mutation AddManualPayment($input: ManualPaymentInput!) {
  1782. addManualPaymentToOrder(input: $input) {
  1783. ...OrderWithModifications
  1784. ... on ErrorResult {
  1785. errorCode
  1786. message
  1787. }
  1788. }
  1789. }
  1790. `,
  1791. [orderWithModificationsFragment],
  1792. );
  1793. export const getOrderWithModificationsDocument = graphql(
  1794. `
  1795. query GetOrderWithModifications($id: ID!) {
  1796. order(id: $id) {
  1797. ...OrderWithModifications
  1798. }
  1799. }
  1800. `,
  1801. [orderWithModificationsFragment],
  1802. );
  1803. export const getOrderWithCustomFieldsDocument = graphql(`
  1804. query GetOrderCustomFields($id: ID!) {
  1805. order(id: $id) {
  1806. # Ignore error - customFields are dynamically generated at runtime, not in introspection schema
  1807. customFields {
  1808. points
  1809. }
  1810. lines {
  1811. id
  1812. # Ignore error - customFields are dynamically generated at runtime, not in introspection schema
  1813. customFields {
  1814. color
  1815. }
  1816. }
  1817. }
  1818. }
  1819. `);
  1820. export const getSettingsStoreValueDocument = graphql(`
  1821. query GetSettingsStoreValue($key: String!) {
  1822. getSettingsStoreValue(key: $key)
  1823. }
  1824. `);
  1825. export const getSettingsStoreValuesDocument = graphql(`
  1826. query GetSettingsStoreValues($keys: [String!]!) {
  1827. getSettingsStoreValues(keys: $keys)
  1828. }
  1829. `);
  1830. export const setSettingsStoreValueDocument = graphql(`
  1831. mutation SetSettingsStoreValue($input: SettingsStoreInput!) {
  1832. setSettingsStoreValue(input: $input) {
  1833. key
  1834. result
  1835. error
  1836. }
  1837. }
  1838. `);
  1839. export const setSettingsStoreValuesDocument = graphql(`
  1840. mutation SetSettingsStoreValues($inputs: [SettingsStoreInput!]!) {
  1841. setSettingsStoreValues(inputs: $inputs) {
  1842. key
  1843. result
  1844. error
  1845. }
  1846. }
  1847. `);
  1848. export const getCheckersDocument = graphql(`
  1849. query GetCheckers {
  1850. shippingEligibilityCheckers {
  1851. code
  1852. args {
  1853. defaultValue
  1854. description
  1855. label
  1856. list
  1857. name
  1858. required
  1859. type
  1860. }
  1861. }
  1862. }
  1863. `);
  1864. export const getZonesDocument = graphql(`
  1865. query GetZones($options: ZoneListOptions) {
  1866. zones(options: $options) {
  1867. items {
  1868. id
  1869. name
  1870. }
  1871. totalItems
  1872. }
  1873. }
  1874. `);
  1875. export const getZoneDocument = graphql(
  1876. `
  1877. query GetZone($id: ID!) {
  1878. zone(id: $id) {
  1879. ...Zone
  1880. }
  1881. }
  1882. `,
  1883. [zoneFragment],
  1884. );
  1885. export const getActiveChannelWithZoneMembersDocument = graphql(`
  1886. query GetActiveChannelWithZoneMembers {
  1887. activeChannel {
  1888. id
  1889. defaultShippingZone {
  1890. id
  1891. members {
  1892. name
  1893. }
  1894. }
  1895. }
  1896. }
  1897. `);
  1898. export const createZoneDocument = graphql(
  1899. `
  1900. mutation CreateZone($input: CreateZoneInput!) {
  1901. createZone(input: $input) {
  1902. ...Zone
  1903. }
  1904. }
  1905. `,
  1906. [zoneFragment],
  1907. );
  1908. export const updateZoneDocument = graphql(
  1909. `
  1910. mutation UpdateZone($input: UpdateZoneInput!) {
  1911. updateZone(input: $input) {
  1912. ...Zone
  1913. }
  1914. }
  1915. `,
  1916. [zoneFragment],
  1917. );
  1918. export const deleteZoneDocument = graphql(`
  1919. mutation DeleteZone($id: ID!) {
  1920. deleteZone(id: $id) {
  1921. result
  1922. message
  1923. }
  1924. }
  1925. `);
  1926. export const addMembersToZoneDocument = graphql(
  1927. `
  1928. mutation AddMembersToZone($zoneId: ID!, $memberIds: [ID!]!) {
  1929. addMembersToZone(zoneId: $zoneId, memberIds: $memberIds) {
  1930. ...Zone
  1931. }
  1932. }
  1933. `,
  1934. [zoneFragment],
  1935. );
  1936. export const removeMembersFromZoneDocument = graphql(
  1937. `
  1938. mutation RemoveMembersFromZone($zoneId: ID!, $memberIds: [ID!]!) {
  1939. removeMembersFromZone(zoneId: $zoneId, memberIds: $memberIds) {
  1940. ...Zone
  1941. }
  1942. }
  1943. `,
  1944. [zoneFragment],
  1945. );
  1946. export const getProductWithCustomFieldsDocument = graphql(`
  1947. query GetProductWithCustomFields($id: ID!) {
  1948. product(id: $id) {
  1949. id
  1950. customFields {
  1951. publicField
  1952. authenticatedField
  1953. updateProductField
  1954. updateProductOrCustomerField
  1955. superadminField
  1956. }
  1957. }
  1958. }
  1959. `);
  1960. export const getProductWithPublicCustomFieldsDocument = graphql(`
  1961. query GetProductWithPublicCustomFields($id: ID!) {
  1962. product(id: $id) {
  1963. id
  1964. customFields {
  1965. publicField
  1966. authenticatedField
  1967. updateProductField
  1968. }
  1969. }
  1970. }
  1971. `);
  1972. export const authenticateDocument = graphql(
  1973. `
  1974. mutation Authenticate($input: AuthenticationInput!) {
  1975. authenticate(input: $input) {
  1976. ...CurrentUser
  1977. ... on InvalidCredentialsError {
  1978. authenticationError
  1979. errorCode
  1980. message
  1981. }
  1982. }
  1983. }
  1984. `,
  1985. [currentUserFragment],
  1986. );
  1987. export const getCustomersDocument = graphql(`
  1988. query GetCustomers {
  1989. customers {
  1990. totalItems
  1991. items {
  1992. id
  1993. emailAddress
  1994. }
  1995. }
  1996. }
  1997. `);
  1998. export const getCustomerUserAuthDocument = graphql(`
  1999. query GetCustomerUserAuth($id: ID!) {
  2000. customer(id: $id) {
  2001. id
  2002. user {
  2003. id
  2004. verified
  2005. authenticationMethods {
  2006. id
  2007. strategy
  2008. }
  2009. }
  2010. }
  2011. }
  2012. `);
  2013. export const updatePromotionDocument = graphql(
  2014. `
  2015. mutation UpdatePromotion($input: UpdatePromotionInput!) {
  2016. updatePromotion(input: $input) {
  2017. ...Promotion
  2018. ... on ErrorResult {
  2019. errorCode
  2020. message
  2021. }
  2022. }
  2023. }
  2024. `,
  2025. [promotionFragment],
  2026. );
  2027. export const getPromotionListDocument = graphql(
  2028. `
  2029. query GetPromotionList($options: PromotionListOptions) {
  2030. promotions(options: $options) {
  2031. items {
  2032. ...Promotion
  2033. }
  2034. totalItems
  2035. }
  2036. }
  2037. `,
  2038. [promotionFragment],
  2039. );
  2040. export const configurableOperationDefFragment = graphql(`
  2041. fragment ConfigurableOperationDef on ConfigurableOperationDefinition {
  2042. args {
  2043. name
  2044. type
  2045. ui
  2046. }
  2047. code
  2048. description
  2049. }
  2050. `);
  2051. export const getAdjustmentOperationsDocument = graphql(
  2052. `
  2053. query GetAdjustmentOperations {
  2054. promotionActions {
  2055. ...ConfigurableOperationDef
  2056. }
  2057. promotionConditions {
  2058. ...ConfigurableOperationDef
  2059. }
  2060. }
  2061. `,
  2062. [configurableOperationDefFragment],
  2063. );
  2064. export const getCustomerWithUserDocument = graphql(`
  2065. query GetCustomerWithUser($id: ID!) {
  2066. customer(id: $id) {
  2067. id
  2068. user {
  2069. id
  2070. identifier
  2071. verified
  2072. }
  2073. }
  2074. }
  2075. `);
  2076. export const getCustomerOrdersDocument = graphql(`
  2077. query GetCustomerOrders($id: ID!) {
  2078. customer(id: $id) {
  2079. orders {
  2080. items {
  2081. id
  2082. }
  2083. totalItems
  2084. }
  2085. }
  2086. }
  2087. `);
  2088. export const addNoteToCustomerDocument = graphql(
  2089. `
  2090. mutation AddNoteToCustomer($input: AddNoteToCustomerInput!) {
  2091. addNoteToCustomer(input: $input) {
  2092. ...Customer
  2093. }
  2094. }
  2095. `,
  2096. [customerFragment],
  2097. );
  2098. export const deleteCustomerAddressDocument = graphql(`
  2099. mutation DeleteCustomerAddress($id: ID!) {
  2100. deleteCustomerAddress(id: $id) {
  2101. success
  2102. }
  2103. }
  2104. `);