admin-definitions.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. import {
  2. assetFragment,
  3. collectionFragment,
  4. countryFragment,
  5. orderWithModificationsFragment,
  6. } from './fragments-admin';
  7. import { graphql } from './graphql-admin';
  8. export const searchProductsAdminDocument = graphql(`
  9. query SearchProductsAdmin($input: SearchInput!) {
  10. search(input: $input) {
  11. totalItems
  12. items {
  13. enabled
  14. productId
  15. productName
  16. slug
  17. description
  18. productVariantId
  19. productVariantName
  20. sku
  21. }
  22. }
  23. }
  24. `);
  25. export const getOrderWithSellerOrdersDocument = graphql(`
  26. query GetOrderWithSellerOrders($id: ID!) {
  27. order(id: $id) {
  28. id
  29. code
  30. state
  31. sellerOrders {
  32. id
  33. aggregateOrderId
  34. lines {
  35. id
  36. productVariant {
  37. id
  38. name
  39. }
  40. }
  41. shippingLines {
  42. id
  43. shippingMethod {
  44. id
  45. code
  46. }
  47. }
  48. }
  49. lines {
  50. id
  51. productVariant {
  52. id
  53. name
  54. }
  55. }
  56. shippingLines {
  57. id
  58. shippingMethod {
  59. id
  60. code
  61. }
  62. }
  63. }
  64. }
  65. `);
  66. export const disableProductDocument = graphql(`
  67. mutation DisableProduct($id: ID!) {
  68. updateProduct(input: { id: $id, enabled: false }) {
  69. id
  70. }
  71. }
  72. `);
  73. export const modifyOrderDocument = graphql(
  74. `
  75. mutation ModifyOrder($input: ModifyOrderInput!) {
  76. modifyOrder(input: $input) {
  77. ...OrderWithModifications
  78. ... on ErrorResult {
  79. errorCode
  80. message
  81. }
  82. }
  83. }
  84. `,
  85. [orderWithModificationsFragment],
  86. );
  87. export const getTagListDocument = graphql(`
  88. query GetTagList($options: TagListOptions) {
  89. tags(options: $options) {
  90. items {
  91. id
  92. value
  93. }
  94. totalItems
  95. }
  96. }
  97. `);
  98. export const getTagDocument = graphql(`
  99. query GetTag($id: ID!) {
  100. tag(id: $id) {
  101. id
  102. value
  103. }
  104. }
  105. `);
  106. export const createTagDocument = graphql(`
  107. mutation CreateTag($input: CreateTagInput!) {
  108. createTag(input: $input) {
  109. id
  110. value
  111. }
  112. }
  113. `);
  114. export const updateTagDocument = graphql(`
  115. mutation UpdateTag($input: UpdateTagInput!) {
  116. updateTag(input: $input) {
  117. id
  118. value
  119. }
  120. }
  121. `);
  122. export const deleteTagDocument = graphql(`
  123. mutation DeleteTag($id: ID!) {
  124. deleteTag(id: $id) {
  125. message
  126. result
  127. }
  128. }
  129. `);
  130. export const getCountryDocument = graphql(
  131. `
  132. query GetCountry($id: ID!) {
  133. country(id: $id) {
  134. ...Country
  135. }
  136. }
  137. `,
  138. [countryFragment],
  139. );
  140. export const createCountryDocument = graphql(
  141. `
  142. mutation CreateCountry($input: CreateCountryInput!) {
  143. createCountry(input: $input) {
  144. ...Country
  145. }
  146. }
  147. `,
  148. [countryFragment],
  149. );
  150. export const deleteCountryDocument = graphql(`
  151. mutation DeleteCountry($id: ID!) {
  152. deleteCountry(id: $id) {
  153. result
  154. message
  155. }
  156. }
  157. `);
  158. export const reindexDocument = graphql(`
  159. mutation Reindex {
  160. reindex {
  161. id
  162. }
  163. }
  164. `);
  165. export const searchGetAssetsDocument = graphql(`
  166. query SearchGetAssets($input: SearchInput!) {
  167. search(input: $input) {
  168. totalItems
  169. items {
  170. productId
  171. productVariantId
  172. productName
  173. productVariantName
  174. productAsset {
  175. id
  176. preview
  177. focalPoint {
  178. x
  179. y
  180. }
  181. }
  182. productVariantAsset {
  183. id
  184. preview
  185. focalPoint {
  186. x
  187. y
  188. }
  189. }
  190. }
  191. }
  192. }
  193. `);
  194. export const searchGetPricesDocument = graphql(`
  195. query SearchGetPrices($input: SearchInput!) {
  196. search(input: $input) {
  197. items {
  198. price {
  199. ... on PriceRange {
  200. min
  201. max
  202. }
  203. ... on SinglePrice {
  204. value
  205. }
  206. }
  207. priceWithTax {
  208. ... on PriceRange {
  209. min
  210. max
  211. }
  212. ... on SinglePrice {
  213. value
  214. }
  215. }
  216. }
  217. }
  218. }
  219. `);
  220. export const syncCustomPermissionsDocument = graphql(`
  221. mutation Sync {
  222. syncWishlist
  223. }
  224. `);
  225. export const crudReadDocument = graphql(`
  226. query CrudRead {
  227. wishlist
  228. }
  229. `);
  230. export const crudCreateDocument = graphql(`
  231. mutation CrudCreate {
  232. createWishlist
  233. }
  234. `);
  235. export const crudUpdateDocument = graphql(`
  236. mutation CrudUpdate {
  237. updateWishlist
  238. }
  239. `);
  240. export const crudDeleteDocument = graphql(`
  241. mutation CrudDelete {
  242. deleteWishlist
  243. }
  244. `);
  245. export const getTaxCategoryListDocument = graphql(`
  246. query GetTaxCategoryList {
  247. taxCategories {
  248. items {
  249. id
  250. name
  251. isDefault
  252. }
  253. }
  254. }
  255. `);
  256. export const getTaxCategoryDocument = graphql(`
  257. query GetTaxCategory($id: ID!) {
  258. taxCategory(id: $id) {
  259. id
  260. name
  261. isDefault
  262. }
  263. }
  264. `);
  265. export const createTaxCategoryDocument = graphql(`
  266. mutation CreateTaxCategory($input: CreateTaxCategoryInput!) {
  267. createTaxCategory(input: $input) {
  268. id
  269. name
  270. isDefault
  271. }
  272. }
  273. `);
  274. export const updateTaxCategoryDocument = graphql(`
  275. mutation UpdateTaxCategory($input: UpdateTaxCategoryInput!) {
  276. updateTaxCategory(input: $input) {
  277. id
  278. name
  279. isDefault
  280. }
  281. }
  282. `);
  283. export const deleteTaxCategoryDocument = graphql(`
  284. mutation DeleteTaxCategory($id: ID!) {
  285. deleteTaxCategory(id: $id) {
  286. result
  287. message
  288. }
  289. }
  290. `);
  291. export const getFulfillmentHandlersDocument = graphql(`
  292. query GetFulfillmentHandlers {
  293. fulfillmentHandlers {
  294. code
  295. description
  296. args {
  297. name
  298. type
  299. description
  300. label
  301. ui
  302. }
  303. }
  304. }
  305. `);
  306. export const getCollectionWithAssetsDocument = graphql(
  307. `
  308. query GetCollectionWithAssets($id: ID!) {
  309. collection(id: $id) {
  310. ...Collection
  311. }
  312. }
  313. `,
  314. [collectionFragment],
  315. );
  316. export const assignAssetsToChannelDocument = graphql(
  317. `
  318. mutation assignAssetsToChannel($input: AssignAssetsToChannelInput!) {
  319. assignAssetsToChannel(input: $input) {
  320. ...Asset
  321. }
  322. }
  323. `,
  324. [assetFragment],
  325. );
  326. export const canCreateCustomerDocument = graphql(`
  327. mutation CanCreateCustomer($input: CreateCustomerInput!) {
  328. createCustomer(input: $input) {
  329. ... on Customer {
  330. id
  331. }
  332. }
  333. }
  334. `);
  335. export const getCustomerCountDocument = graphql(`
  336. query GetCustomerCount {
  337. customers {
  338. totalItems
  339. }
  340. }
  341. `);
  342. export const getProductWithTransactionsDocument = graphql(`
  343. query GetProductWithTransactions($id: ID!) {
  344. product(id: $id) {
  345. id
  346. transactions {
  347. id
  348. amount
  349. description
  350. }
  351. }
  352. }
  353. `);
  354. export const deepFieldResolutionTestQueryDocument = graphql(`
  355. query DeepFieldResolutionTestQuery {
  356. product(id: "T_1") {
  357. variants {
  358. taxRateApplied {
  359. customerGroup {
  360. customers {
  361. items {
  362. id
  363. emailAddress
  364. }
  365. }
  366. }
  367. }
  368. }
  369. }
  370. }
  371. `);
  372. export const issue2097QueryDocument = graphql(`
  373. query Issue2097 {
  374. ownerProtectedThing
  375. publicThing
  376. }
  377. `);
  378. export const testGetStockLocationsListDocument = graphql(`
  379. query TestGetStockLocationsList($options: StockLocationListOptions) {
  380. stockLocations(options: $options) {
  381. items {
  382. id
  383. name
  384. description
  385. }
  386. totalItems
  387. }
  388. }
  389. `);
  390. export const testCreateStockLocationDocument = graphql(`
  391. mutation TestCreateStockLocation($input: CreateStockLocationInput!) {
  392. createStockLocation(input: $input) {
  393. id
  394. name
  395. description
  396. }
  397. }
  398. `);
  399. export const testUpdateStockLocationDocument = graphql(`
  400. mutation TestUpdateStockLocation($input: UpdateStockLocationInput!) {
  401. updateStockLocation(input: $input) {
  402. id
  403. name
  404. description
  405. }
  406. }
  407. `);
  408. export const testDeleteStockLocationDocument = graphql(`
  409. mutation TestDeleteStockLocation($input: DeleteStockLocationInput!) {
  410. deleteStockLocation(input: $input) {
  411. result
  412. message
  413. }
  414. }
  415. `);
  416. export const testGetStockLevelsForVariantDocument = graphql(`
  417. query TestGetStockLevelsForVariant($id: ID!) {
  418. productVariant(id: $id) {
  419. id
  420. stockLevels {
  421. stockOnHand
  422. stockAllocated
  423. stockLocationId
  424. }
  425. }
  426. }
  427. `);
  428. export const testSetStockLevelInLocationDocument = graphql(`
  429. mutation TestSetStockLevelInLocation($input: UpdateProductVariantInput!) {
  430. updateProductVariants(input: [$input]) {
  431. id
  432. stockLevels {
  433. stockOnHand
  434. stockAllocated
  435. stockLocationId
  436. }
  437. }
  438. }
  439. `);
  440. export const testAssignStockLocationToChannelDocument = graphql(`
  441. mutation TestAssignStockLocationToChannel($input: AssignStockLocationsToChannelInput!) {
  442. assignStockLocationsToChannel(input: $input) {
  443. id
  444. name
  445. }
  446. }
  447. `);
  448. export const testRemoveStockLocationsFromChannelDocument = graphql(`
  449. mutation TestRemoveStockLocationsFromChannel($input: RemoveStockLocationsFromChannelInput!) {
  450. removeStockLocationsFromChannel(input: $input) {
  451. id
  452. name
  453. }
  454. }
  455. `);