gql.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. const category_by_props = `
  2. query categorybyprops($sort_by: category_sort_by, $limit: Int, $status: String) {
  3. categorybyprops: category_by_props(sort_by: $sort_by limit: $limit status: $status) {
  4. id
  5. text:name
  6. icon:img
  7. status
  8. }
  9. }
  10. `
  11. const update_category = `
  12. mutation updatecategory($id: ID, $img: String, $order: Int, $status: String, $updatedAt: String) {
  13. updatecategory: update_category(id: $id img: $img order: $order status: $status updatedAt: $updatedAt) {
  14. result
  15. category {
  16. id
  17. name
  18. img
  19. order
  20. status
  21. createdAt
  22. updatedAt
  23. }
  24. }
  25. }
  26. `
  27. const delete_category = `
  28. mutation deletecategory($id: ID) {
  29. deletecategory: delete_category(id: $id)
  30. }
  31. `
  32. const create_category = `
  33. mutation createcategory($id: ID!, $name: String, $img: String, $order: Int, $status: String, $createdAt: String, $updatedAt: String) {
  34. createcategory: create_category(id: $id name: $name img: $img order: $order status: $status createdAt: $createdAt updatedAt: $updatedAt) {
  35. result
  36. category {
  37. id
  38. name
  39. img
  40. order
  41. status
  42. createdAt
  43. updatedAt
  44. }
  45. }
  46. }
  47. `
  48. const productbyprops = `
  49. query productbyprops($recommend: Int, $where: product_filter, $sort_by: product_sort_by, $limit: Int, $unit: String, $order_by: OrderBy, $name: String, $filter: Filter, $status: String, $price: Float, $category_id: ID, $img: String, $stock: Int, $skip: Int) {
  50. productbyprops: product_by_props(recommend: $recommend where: $where sort_by: $sort_by limit: $limit unit: $unit order_by: $order_by name: $name filter: $filter status: $status price: $price category_id: $category_id img: $img stock: $stock skip: $skip) {
  51. recommend
  52. category_id{
  53. id
  54. name
  55. }
  56. updatedAt
  57. unit
  58. name
  59. createdAt
  60. status
  61. id
  62. intro
  63. price
  64. img
  65. stock
  66. }
  67. }
  68. `
  69. const productAndSpec_by_id = `
  70. query productbyid($id: ID) {
  71. productbyid: product_by_id(id: $id) {
  72. category_id{
  73. id
  74. }
  75. updatedAt
  76. unit
  77. name
  78. createdAt
  79. status
  80. id
  81. intro
  82. price
  83. img
  84. stock
  85. }
  86. spec: specificationStock_by_props(product_id: $id ) {
  87. id
  88. color
  89. size
  90. slideImg
  91. detailImg
  92. stock
  93. status
  94. }
  95. }
  96. `
  97. const create_userCart = `
  98. mutation createuserCart($id: ID!, $user_id: ID, $product_id: ID, $specificationStock_id: ID, $count: Int, $createdAt: String, $updatedAt: String) {
  99. createuserCart: create_userCart(id: $id user_id: $user_id product_id: $product_id specificationStock_id: $specificationStock_id count: $count createdAt: $createdAt updatedAt: $updatedAt) {
  100. result
  101. userCart {
  102. id
  103. user_id {
  104. id
  105. }
  106. product_id {
  107. recommend
  108. unit
  109. name
  110. status
  111. id
  112. intro
  113. price
  114. img
  115. stock
  116. }
  117. specificationStock_id {
  118. id
  119. color
  120. size
  121. stock
  122. status
  123. }
  124. count
  125. createdAt
  126. updatedAt
  127. }
  128. }
  129. }
  130. `
  131. const cart_by_userid = `
  132. query findUserCart($user_id:ID){
  133. cartList:userCart_by_props(user_id:$user_id){
  134. count
  135. createdAt
  136. id
  137. product_id{
  138. id
  139. img
  140. intro
  141. name
  142. price
  143. status
  144. stock
  145. unit
  146. }
  147. specificationStock_id{
  148. id
  149. color
  150. size
  151. stock
  152. status
  153. }
  154. }
  155. }
  156. `
  157. const update_userCart = `
  158. mutation updateuserCart($id: ID, $specificationStock_id: ID, $count: Int, $updatedAt: String, $where: userCart_filter) {
  159. updateuserCart: update_userCart(id: $id specificationStock_id: $specificationStock_id count: $count updatedAt: $updatedAt where: $where) {
  160. result
  161. userCart {
  162. id
  163. product_id {
  164. id
  165. }
  166. specificationStock_id {
  167. updatedAt
  168. color
  169. size
  170. slideImg
  171. status
  172. id
  173. detailImg
  174. stock
  175. }
  176. count
  177. createdAt
  178. updatedAt
  179. }
  180. }
  181. }
  182. `
  183. const delete_userCart_by_id = `
  184. mutation delete_userCart($id: [String]) {
  185. delete_userCart(where: {
  186. id: {
  187. _in: $id
  188. }
  189. })
  190. }
  191. `
  192. const userAddressbyprops = `
  193. query userAddressbyprops($user_id: ID) {
  194. userAddressbyprops: userAddress_by_props(user_id: $user_id) {
  195. address
  196. updatedAt
  197. telephone
  198. default
  199. city
  200. username
  201. postcode
  202. createdAt
  203. deletedAt
  204. id
  205. user_id {
  206. email
  207. telephone
  208. username
  209. openid
  210. id
  211. }
  212. area
  213. province
  214. }
  215. }
  216. `
  217. const user_default_address = `
  218. query user_default_address($user_id: ID, $default: Int) {
  219. defaultAddress: userAddress_by_props(user_id: $user_id default: $default) {
  220. id
  221. default
  222. username
  223. telephone
  224. province
  225. area
  226. city
  227. address
  228. user_id {
  229. openid
  230. id
  231. }
  232. }
  233. }
  234. `
  235. const orderbyprops = `
  236. query orderbyprops($updatedAt: String, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
  237. orderbyprops: order_by_props(updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  238. updatedAt
  239. orderLogistics_id {
  240. deliveryTime
  241. serviceStore
  242. updatedAt
  243. logisticsFee
  244. expressId
  245. createdAt
  246. consigneeTel
  247. id
  248. expressName
  249. consignAddress
  250. LogisticsStatus
  251. consigneeName
  252. }
  253. orderTotalPay
  254. createdAt
  255. orderStatus
  256. userAddress_id {
  257. address
  258. updatedAt
  259. telephone
  260. default
  261. city
  262. username
  263. postcode
  264. createdAt
  265. deletedAt
  266. id
  267. area
  268. province
  269. }
  270. id
  271. count
  272. productTotalPay
  273. orderPay_id {
  274. updatedAt
  275. tradeNo
  276. transactionId
  277. time
  278. createdAt
  279. openid
  280. id
  281. totalFee
  282. cashFee
  283. }
  284. }
  285. }
  286. `
  287. const order_by_id = `
  288. query orderbyid($id: ID) {
  289. orderbyid: order_by_id(id: $id) {
  290. remark
  291. updatedAt
  292. orderLogistics_id {
  293. deliveryTime
  294. serviceStore
  295. updatedAt
  296. logisticsFee
  297. expressId
  298. createdAt
  299. consigneeTel
  300. id
  301. expressName
  302. consignAddress
  303. LogisticsStatus
  304. consigneeName
  305. }
  306. orderTotalPay
  307. createdAt
  308. orderStatus
  309. userAddress_id {
  310. address
  311. updatedAt
  312. telephone
  313. default
  314. city
  315. username
  316. postcode
  317. createdAt
  318. deletedAt
  319. id
  320. area
  321. province
  322. }
  323. id
  324. count
  325. user_id {
  326. email
  327. updatedAt
  328. password
  329. telephone
  330. username
  331. createdAt
  332. openid
  333. id
  334. }
  335. productTotalPay
  336. orderPay_id {
  337. updatedAt
  338. tradeNo
  339. transactionId
  340. time
  341. createdAt
  342. openid
  343. id
  344. totalFee
  345. cashFee
  346. }
  347. }
  348. }
  349. `
  350. const orderProduct_by_props = `
  351. query orderProductbyprops($order_id: ID) {
  352. orderProductbyprops: orderProduct_by_props(order_id: $order_id) {
  353. updatedAt
  354. productColor
  355. unit
  356. product_id {
  357. updatedAt
  358. unit
  359. name
  360. createdAt
  361. status
  362. id
  363. intro
  364. price
  365. img
  366. stock
  367. }
  368. productSize
  369. orderPay
  370. createdAt
  371. productImg
  372. productName
  373. productPrice
  374. id
  375. count
  376. productPay
  377. }
  378. }
  379. `
  380. const create_order = `
  381. mutation createorder($remark: String, $updatedAt: String, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID!, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID,
  382. $deliveryTime: String, $serviceStore: String, $logisticsFee: Float, $expressId: String, $order_id: ID, $consigneeTel: String, $orderLogisticsId: ID!, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $consigneeName: String
  383. $deleteId: [String]) {
  384. createorder: create_order(remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  385. result
  386. order {
  387. remark
  388. updatedAt
  389. orderLogistics_id {
  390. deliveryTime
  391. serviceStore
  392. updatedAt
  393. logisticsFee
  394. expressId
  395. createdAt
  396. consigneeTel
  397. id
  398. expressName
  399. consignAddress
  400. LogisticsStatus
  401. consigneeName
  402. }
  403. orderTotalPay
  404. createdAt
  405. orderStatus
  406. userAddress_id {
  407. address
  408. updatedAt
  409. telephone
  410. default
  411. city
  412. username
  413. postcode
  414. createdAt
  415. deletedAt
  416. id
  417. area
  418. province
  419. }
  420. id
  421. count
  422. productTotalPay
  423. orderPay_id {
  424. updatedAt
  425. tradeNo
  426. transactionId
  427. time
  428. createdAt
  429. openid
  430. id
  431. totalFee
  432. cashFee
  433. }
  434. }
  435. }
  436. createorderLogistics: create_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $orderLogisticsId expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
  437. result
  438. orderLogistics {
  439. deliveryTime
  440. serviceStore
  441. updatedAt
  442. logisticsFee
  443. expressId
  444. createdAt
  445. order_id {
  446. remark
  447. updatedAt
  448. orderTotalPay
  449. createdAt
  450. orderStatus
  451. id
  452. count
  453. productTotalPay
  454. }
  455. consigneeTel
  456. id
  457. expressName
  458. consignAddress
  459. LogisticsStatus
  460. user_id {
  461. email
  462. updatedAt
  463. password
  464. telephone
  465. username
  466. createdAt
  467. openid
  468. id
  469. }
  470. consigneeName
  471. }
  472. }
  473. delete_userCart(where: {
  474. id: {
  475. _in: $deleteId
  476. }
  477. })
  478. }
  479. `
  480. const create_order_product = `
  481. mutation createorderProduct($updatedAt: String, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $specificationStock_id: ID, $order_id: ID, $productPrice: Float, $id: ID!, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID) {
  482. createorderProduct: create_orderProduct(updatedAt: $updatedAt productColor: $productColor unit: $unit product_id: $product_id productSize: $productSize orderPay: $orderPay createdAt: $createdAt productImg: $productImg productName: $productName specificationStock_id: $specificationStock_id order_id: $order_id productPrice: $productPrice id: $id count: $count productPay: $productPay user_id: $user_id orderPay_id: $orderPay_id) {
  483. result
  484. orderProduct {
  485. updatedAt
  486. productColor
  487. unit
  488. productSize
  489. orderPay
  490. createdAt
  491. productImg
  492. productName
  493. productPrice
  494. id
  495. count
  496. productPay
  497. }
  498. }
  499. }
  500. `
  501. const shop_by_props = `
  502. query shopbyprops($limit: Int) {
  503. shopbyprops: shop_by_props(limit: $limit) {
  504. description
  505. address
  506. updatedAt
  507. telephone
  508. name
  509. createdAt
  510. status
  511. id
  512. slideshow
  513. notice
  514. intro
  515. img
  516. }
  517. }
  518. `
  519. const update_shop = `
  520. mutation updateshop($description: String, $address: String, $updatedAt: String, $where: shop_filter, $telephone: String, $name: String, $createdAt: String, $status: String, $id: ID, $slideshow: String, $notice: String, $intro: String, $img: String) {
  521. updateshop: update_shop(id: $id description: $description address: $address updatedAt: $updatedAt where: $where telephone: $telephone name: $name createdAt: $createdAt status: $status slideshow: $slideshow notice: $notice intro: $intro img: $img) {
  522. result
  523. shop {
  524. description
  525. address
  526. updatedAt
  527. telephone
  528. name
  529. createdAt
  530. status
  531. id
  532. slideshow
  533. notice
  534. intro
  535. img
  536. }
  537. }
  538. }
  539. `
  540. const create_shop = `
  541. mutation createshop($description: String, $address: String, $updatedAt: String, $telephone: String, $name: String, $createdAt: String, $status: String, $id: ID!, $slideshow: String, $notice: String, $intro: String, $img: String) {
  542. createshop: create_shop(description: $description address: $address updatedAt: $updatedAt telephone: $telephone name: $name createdAt: $createdAt status: $status id: $id slideshow: $slideshow notice: $notice intro: $intro img: $img) {
  543. result
  544. shop {
  545. description
  546. address
  547. updatedAt
  548. telephone
  549. name
  550. createdAt
  551. status
  552. id
  553. slideshow
  554. notice
  555. intro
  556. img
  557. }
  558. }
  559. }
  560. `
  561. const create_product = `
  562. mutation createproduct($recommend: Int, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID!, $intro: String, $discountRate: Float, $price: Float, $category_id: ID, $img: String, $stock: Int) {
  563. createproduct: create_product(recommend: $recommend updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt status: $status id: $id intro: $intro discountRate: $discountRate price: $price category_id: $category_id img: $img stock: $stock) {
  564. result
  565. product {
  566. recommend
  567. updatedAt
  568. unit
  569. name
  570. createdAt
  571. status
  572. id
  573. intro
  574. discountRate
  575. price
  576. img
  577. stock
  578. }
  579. }
  580. }
  581. `
  582. const update_product = `
  583. mutation updateproduct($recommend: Int, $updatedAt: String, $where: product_filter, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID, $intro: String, $price: Float, $category_id: ID, $img: String, $stock: Int) {
  584. updateproduct: update_product(id: $id recommend: $recommend updatedAt: $updatedAt where: $where unit: $unit name: $name createdAt: $createdAt status: $status intro: $intro price: $price category_id: $category_id img: $img stock: $stock) {
  585. result
  586. product {
  587. recommend
  588. updatedAt
  589. unit
  590. name
  591. createdAt
  592. status
  593. id
  594. intro
  595. price
  596. img
  597. stock
  598. }
  599. }
  600. }
  601. `
  602. export {
  603. category_by_props,
  604. update_category,
  605. delete_category,
  606. create_category,
  607. productbyprops,
  608. productAndSpec_by_id,
  609. create_userCart,
  610. cart_by_userid,
  611. update_userCart,
  612. delete_userCart_by_id,
  613. userAddressbyprops,
  614. user_default_address,
  615. orderbyprops,
  616. order_by_id,
  617. orderProduct_by_props,
  618. create_order,
  619. create_order_product,
  620. shop_by_props,
  621. create_shop,
  622. update_shop,
  623. create_product,
  624. update_product
  625. }