gql.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. const create_user = `
  2. mutation createuser($email: String, $updatedAt: String, $password: String, $telephone: String, $username: String, $createdAt: String, $openid: String, $id: ID!, $userData_id: ID) {
  3. createuser: create_user(email: $email updatedAt: $updatedAt password: $password telephone: $telephone username: $username createdAt: $createdAt openid: $openid id: $id userData_id: $userData_id) {
  4. result
  5. user {
  6. email
  7. updatedAt
  8. password
  9. telephone
  10. username
  11. createdAt
  12. openid
  13. id
  14. }
  15. }
  16. }
  17. `
  18. const find_user_by_openid = `
  19. query userbyprops($openid: String) {
  20. userbyprops: user_by_props(openid: $openid) {
  21. id
  22. }
  23. }
  24. `
  25. const user_by_id = `
  26. query userbyid($id: ID) {
  27. userbyid: user_by_id(id: $id) {
  28. email
  29. updatedAt
  30. password
  31. telephone
  32. username
  33. createdAt
  34. openid
  35. id
  36. userData_id {
  37. id
  38. nickname
  39. avatar
  40. isVip
  41. vipCode
  42. userPoint
  43. createdAt
  44. updatedAt
  45. }
  46. }
  47. }
  48. `
  49. const update_user = `
  50. mutation updateuser($id: ID, $email: String, $updatedAt: String, $where: user_filter, $password: String, $telephone: String, $username: String, $createdAt: String, $openid: String, $userData_id: ID) {
  51. updateuser: update_user(id: $id email: $email updatedAt: $updatedAt where: $where password: $password telephone: $telephone username: $username createdAt: $createdAt openid: $openid userData_id: $userData_id) {
  52. result
  53. user {
  54. email
  55. updatedAt
  56. password
  57. telephone
  58. username
  59. createdAt
  60. openid
  61. id
  62. }
  63. }
  64. }
  65. `
  66. const category_by_props = `
  67. query categorybyprops($sort_by: category_sort_by, $limit: Int, $status: String) {
  68. categorybyprops: category_by_props(sort_by: $sort_by limit: $limit status: $status) {
  69. id
  70. text:name
  71. icon:img
  72. status
  73. }
  74. }
  75. `
  76. const update_category = `
  77. mutation updatecategory($id: ID, $img: String, $order: Int, $status: String, $updatedAt: String) {
  78. updatecategory: update_category(id: $id img: $img order: $order status: $status updatedAt: $updatedAt) {
  79. result
  80. category {
  81. id
  82. name
  83. img
  84. order
  85. status
  86. createdAt
  87. updatedAt
  88. }
  89. }
  90. }
  91. `
  92. const delete_category = `
  93. mutation deletecategory($id: ID) {
  94. deletecategory: delete_category(id: $id)
  95. }
  96. `
  97. const create_category = `
  98. mutation createcategory($id: ID!, $name: String, $img: String, $order: Int, $status: String, $createdAt: String, $updatedAt: String) {
  99. createcategory: create_category(id: $id name: $name img: $img order: $order status: $status createdAt: $createdAt updatedAt: $updatedAt) {
  100. result
  101. category {
  102. id
  103. name
  104. img
  105. order
  106. status
  107. createdAt
  108. updatedAt
  109. }
  110. }
  111. }
  112. `
  113. const productbyprops = `
  114. 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) {
  115. 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) {
  116. recommend
  117. category_id{
  118. id
  119. name
  120. }
  121. updatedAt
  122. unit
  123. name
  124. createdAt
  125. status
  126. id
  127. intro
  128. price
  129. img
  130. stock
  131. discountRate
  132. }
  133. }
  134. `
  135. const productAndSpec_by_id = `
  136. query productbyid($id: ID) {
  137. productbyid: product_by_id(id: $id) {
  138. category_id{
  139. id
  140. }
  141. updatedAt
  142. unit
  143. name
  144. createdAt
  145. status
  146. id
  147. intro
  148. price
  149. img
  150. stock
  151. discountRate
  152. }
  153. spec: specificationStock_by_props(product_id: $id ) {
  154. id
  155. color
  156. size
  157. slideImg
  158. detailImg
  159. stock
  160. status
  161. }
  162. }
  163. `
  164. const specificationStock_by_props = `
  165. query specificationStockbyprops($product_id: ID) {
  166. specificationStockbyprops: specificationStock_by_props(product_id: $product_id) {
  167. updatedAt
  168. color
  169. createdAt
  170. size
  171. slideImg
  172. status
  173. id
  174. detailImg
  175. stock
  176. }
  177. }
  178. `
  179. const create_specificationStock = `
  180. mutation createspecificationStock($updatedAt: String, $color: String, $product_id: ID, $createdAt: String, $size: String, $slideImg: String, $status: String, $id: ID!, $detailImg: String, $stock: Int) {
  181. createspecificationStock: create_specificationStock(updatedAt: $updatedAt color: $color product_id: $product_id createdAt: $createdAt size: $size slideImg: $slideImg status: $status id: $id detailImg: $detailImg stock: $stock) {
  182. result
  183. specificationStock {
  184. updatedAt
  185. color
  186. createdAt
  187. size
  188. slideImg
  189. status
  190. id
  191. detailImg
  192. stock
  193. }
  194. }
  195. }
  196. `
  197. const delete_specificationStock = `
  198. mutation deletespecificationStock($id: ID) {
  199. deletespecificationStock: delete_specificationStock(id: $id)
  200. }
  201. `
  202. const update_specificationStock = `
  203. mutation updatespecificationStock($id: ID, $updatedAt: String, $color: String, $size: String, $slideImg: String, $status: String, $detailImg: String, $stock: Int) {
  204. updatespecificationStock: update_specificationStock(id: $id updatedAt: $updatedAt color: $color size: $size slideImg: $slideImg status: $status detailImg: $detailImg stock: $stock) {
  205. result
  206. specificationStock {
  207. updatedAt
  208. color
  209. createdAt
  210. size
  211. slideImg
  212. status
  213. id
  214. detailImg
  215. stock
  216. }
  217. }
  218. }
  219. `
  220. const create_userCart = `
  221. mutation createuserCart($id: ID!, $user_id: ID, $product_id: ID, $specificationStock_id: ID, $count: Int, $createdAt: String, $updatedAt: String) {
  222. createuserCart: create_userCart(id: $id user_id: $user_id product_id: $product_id specificationStock_id: $specificationStock_id count: $count createdAt: $createdAt updatedAt: $updatedAt) {
  223. result
  224. userCart {
  225. id
  226. user_id {
  227. id
  228. }
  229. product_id {
  230. recommend
  231. unit
  232. name
  233. status
  234. id
  235. intro
  236. price
  237. img
  238. stock
  239. discountRate
  240. }
  241. specificationStock_id {
  242. id
  243. color
  244. size
  245. stock
  246. status
  247. }
  248. count
  249. createdAt
  250. updatedAt
  251. }
  252. }
  253. }
  254. `
  255. const cart_by_userid = `
  256. query findUserCart($user_id:ID){
  257. cartList:userCart_by_props(user_id:$user_id){
  258. count
  259. createdAt
  260. id
  261. product_id{
  262. id
  263. img
  264. intro
  265. name
  266. price
  267. status
  268. stock
  269. unit
  270. discountRate
  271. }
  272. specificationStock_id{
  273. id
  274. color
  275. size
  276. stock
  277. status
  278. }
  279. }
  280. }
  281. `
  282. const update_userCart = `
  283. mutation updateuserCart($id: ID, $specificationStock_id: ID, $count: Int, $updatedAt: String, $where: userCart_filter) {
  284. updateuserCart: update_userCart(id: $id specificationStock_id: $specificationStock_id count: $count updatedAt: $updatedAt where: $where) {
  285. result
  286. userCart {
  287. id
  288. product_id {
  289. id
  290. }
  291. specificationStock_id {
  292. updatedAt
  293. color
  294. size
  295. slideImg
  296. status
  297. id
  298. detailImg
  299. stock
  300. }
  301. count
  302. createdAt
  303. updatedAt
  304. }
  305. }
  306. }
  307. `
  308. const delete_userCart_by_id = `
  309. mutation delete_userCart($id: [String]) {
  310. delete_userCart(where: {
  311. id: {
  312. _in: $id
  313. }
  314. })
  315. }
  316. `
  317. const create_update_userAddress = `
  318. mutation createuserAddress( $id: ID!, $address: String, $updatedAt: String, $telephone: String, $default: Int, $city: String, $username: String, $postcode: String, $createdAt: String, $deletedAt: String, $user_id: ID, $area: String, $province: String,
  319. $updateID: ID!, $updateDefault: Int, $newUpdatedAt: String) {
  320. createuserAddress: create_userAddress(id: $id address: $address updatedAt: $updatedAt telephone: $telephone default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt user_id: $user_id area: $area province: $province) {
  321. result
  322. userAddress {
  323. address
  324. updatedAt
  325. telephone
  326. default
  327. city
  328. username
  329. postcode
  330. createdAt
  331. deletedAt
  332. id
  333. area
  334. province
  335. }
  336. }
  337. updateuserAddress: update_userAddress(id: $updateID default: $updateDefault updatedAt: $createdAt) {
  338. result
  339. userAddress {
  340. address
  341. updatedAt
  342. telephone
  343. default
  344. city
  345. username
  346. postcode
  347. createdAt
  348. deletedAt
  349. id
  350. area
  351. province
  352. }
  353. }
  354. }
  355. `
  356. const update_userAddress = `
  357. mutation updateuserAddress($id: ID, $address: String, $updatedAt: String, $where: userAddress_filter, $telephone: String, $default: Int, $city: String, $username: String, $postcode: String, $createdAt: String, $deletedAt: String, $user_id: ID, $area: String, $province: String,
  358. $updateID: ID!, $updateDefault: Int, $newUpdatedAt: String) {
  359. updateAddress: update_userAddress(id: $id address: $address updatedAt: $updatedAt where: $where telephone: $telephone default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt user_id: $user_id area: $area province: $province) {
  360. result
  361. userAddress {
  362. address
  363. updatedAt
  364. telephone
  365. default
  366. city
  367. username
  368. postcode
  369. createdAt
  370. deletedAt
  371. id
  372. area
  373. province
  374. }
  375. }
  376. updateuserAddress: update_userAddress(id: $updateID default: $updateDefault updatedAt: $createdAt) {
  377. result
  378. userAddress {
  379. address
  380. updatedAt
  381. telephone
  382. default
  383. city
  384. username
  385. postcode
  386. createdAt
  387. deletedAt
  388. id
  389. area
  390. province
  391. }
  392. }
  393. }
  394. `
  395. const userAddressbyprops = `
  396. query userAddressbyprops($user_id: ID) {
  397. userAddressbyprops: userAddress_by_props(user_id: $user_id) {
  398. address
  399. updatedAt
  400. telephone
  401. default
  402. city
  403. username
  404. postcode
  405. createdAt
  406. deletedAt
  407. id
  408. user_id {
  409. email
  410. telephone
  411. username
  412. openid
  413. id
  414. }
  415. area
  416. province
  417. }
  418. }
  419. `
  420. const user_default_address = `
  421. query user_default_address($user_id: ID, $default: Int) {
  422. defaultAddress: userAddress_by_props(user_id: $user_id default: $default) {
  423. id
  424. default
  425. username
  426. telephone
  427. province
  428. area
  429. city
  430. address
  431. user_id {
  432. openid
  433. id
  434. }
  435. }
  436. }
  437. `
  438. const delete_address = `
  439. mutation deleteuserAddress($id: ID) {
  440. deleteuserAddress: delete_userAddress(id: $id)
  441. }
  442. `
  443. const orderbyprops = `
  444. query orderbyprops($updatedAt: String, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
  445. orderbyprops: order_by_props(updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  446. updatedAt
  447. orderLogistics_id {
  448. deliveryTime
  449. serviceStore
  450. updatedAt
  451. logisticsFee
  452. expressId
  453. createdAt
  454. consigneeTel
  455. id
  456. expressName
  457. consignAddress
  458. LogisticsStatus
  459. consigneeName
  460. }
  461. orderTotalPay
  462. createdAt
  463. orderStatus
  464. id
  465. count
  466. productTotalPay
  467. orderPay_id {
  468. updatedAt
  469. tradeNo
  470. transactionId
  471. time
  472. createdAt
  473. openid
  474. id
  475. totalFee
  476. cashFee
  477. }
  478. }
  479. }
  480. `
  481. const order_by_id = `
  482. query orderbyid($id: ID) {
  483. orderbyid: order_by_id(id: $id) {
  484. remark
  485. updatedAt
  486. orderLogistics_id {
  487. deliveryTime
  488. serviceStore
  489. updatedAt
  490. logisticsFee
  491. expressId
  492. createdAt
  493. consigneeTel
  494. id
  495. expressName
  496. consignAddress
  497. LogisticsStatus
  498. consigneeName
  499. }
  500. orderTotalPay
  501. createdAt
  502. orderStatus
  503. id
  504. count
  505. user_id {
  506. email
  507. updatedAt
  508. password
  509. telephone
  510. username
  511. createdAt
  512. openid
  513. id
  514. }
  515. productTotalPay
  516. orderPay_id {
  517. updatedAt
  518. tradeNo
  519. transactionId
  520. time
  521. createdAt
  522. openid
  523. id
  524. totalFee
  525. cashFee
  526. }
  527. }
  528. }
  529. `
  530. const update_order = `
  531. mutation updateorder($id: ID, $updatedAt: String, $orderStatus: String, $orderPay_id: ID) {
  532. updateorder: update_order(id: $id updatedAt: $updatedAt orderStatus: $orderStatus orderPay_id: $orderPay_id) {
  533. result
  534. order {
  535. remark
  536. updatedAt
  537. orderTotalPay
  538. createdAt
  539. orderStatus
  540. id
  541. count
  542. productTotalPay
  543. }
  544. }
  545. }
  546. `
  547. const delete_order = `
  548. mutation deleteorder($id: ID) {
  549. deleteorder: delete_order(id: $id)
  550. }
  551. `
  552. const orderProduct_by_props = `
  553. query orderProductbyprops($order_id: ID) {
  554. orderProductbyprops: orderProduct_by_props(order_id: $order_id) {
  555. updatedAt
  556. productColor
  557. unit
  558. product_id {
  559. updatedAt
  560. unit
  561. name
  562. createdAt
  563. status
  564. id
  565. intro
  566. price
  567. img
  568. stock
  569. discountRate
  570. }
  571. productSize
  572. orderPay
  573. createdAt
  574. productImg
  575. productName
  576. productPrice
  577. id
  578. count
  579. productPay
  580. }
  581. }
  582. `
  583. const create_order = `
  584. 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,
  585. $deliveryTime: String, $serviceStore: String, $logisticsFee: Float, $expressId: String, $order_id: ID, $consigneeTel: String, $orderLogisticsId: ID!, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $consigneeName: String
  586. $deleteId: [String]) {
  587. 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) {
  588. result
  589. order {
  590. remark
  591. updatedAt
  592. orderLogistics_id {
  593. deliveryTime
  594. serviceStore
  595. updatedAt
  596. logisticsFee
  597. expressId
  598. createdAt
  599. consigneeTel
  600. id
  601. expressName
  602. consignAddress
  603. LogisticsStatus
  604. consigneeName
  605. }
  606. orderTotalPay
  607. createdAt
  608. orderStatus
  609. userAddress_id {
  610. address
  611. updatedAt
  612. telephone
  613. default
  614. city
  615. username
  616. postcode
  617. createdAt
  618. deletedAt
  619. id
  620. area
  621. province
  622. }
  623. id
  624. count
  625. productTotalPay
  626. orderPay_id {
  627. updatedAt
  628. tradeNo
  629. transactionId
  630. time
  631. createdAt
  632. openid
  633. id
  634. totalFee
  635. cashFee
  636. }
  637. }
  638. }
  639. 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) {
  640. result
  641. orderLogistics {
  642. deliveryTime
  643. serviceStore
  644. updatedAt
  645. logisticsFee
  646. expressId
  647. createdAt
  648. order_id {
  649. remark
  650. updatedAt
  651. orderTotalPay
  652. createdAt
  653. orderStatus
  654. id
  655. count
  656. productTotalPay
  657. }
  658. consigneeTel
  659. id
  660. expressName
  661. consignAddress
  662. LogisticsStatus
  663. user_id {
  664. email
  665. updatedAt
  666. password
  667. telephone
  668. username
  669. createdAt
  670. openid
  671. id
  672. }
  673. consigneeName
  674. }
  675. }
  676. delete_userCart(where: {
  677. id: {
  678. _in: $deleteId
  679. }
  680. })
  681. }
  682. `
  683. const create_order_product = `
  684. 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) {
  685. 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) {
  686. result
  687. orderProduct {
  688. updatedAt
  689. productColor
  690. unit
  691. productSize
  692. orderPay
  693. createdAt
  694. productImg
  695. productName
  696. productPrice
  697. id
  698. count
  699. productPay
  700. }
  701. }
  702. }
  703. `
  704. const shop_by_props = `
  705. query shopbyprops($limit: Int) {
  706. shopbyprops: shop_by_props(limit: $limit) {
  707. description
  708. address
  709. updatedAt
  710. telephone
  711. name
  712. createdAt
  713. status
  714. id
  715. slideshow
  716. notice
  717. intro
  718. img
  719. }
  720. }
  721. `
  722. const update_shop = `
  723. 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) {
  724. 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) {
  725. result
  726. shop {
  727. description
  728. address
  729. updatedAt
  730. telephone
  731. name
  732. createdAt
  733. status
  734. id
  735. slideshow
  736. notice
  737. intro
  738. img
  739. }
  740. }
  741. }
  742. `
  743. const create_shop = `
  744. 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) {
  745. 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) {
  746. result
  747. shop {
  748. description
  749. address
  750. updatedAt
  751. telephone
  752. name
  753. createdAt
  754. status
  755. id
  756. slideshow
  757. notice
  758. intro
  759. img
  760. }
  761. }
  762. }
  763. `
  764. const create_product = `
  765. 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) {
  766. 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) {
  767. result
  768. product {
  769. recommend
  770. updatedAt
  771. unit
  772. name
  773. createdAt
  774. status
  775. id
  776. intro
  777. discountRate
  778. price
  779. img
  780. stock
  781. }
  782. }
  783. }
  784. `
  785. const update_product = `
  786. mutation updateproduct($id: ID, $recommend: Int, $updatedAt: String, $where: product_filter, $unit: String, $name: String, $createdAt: String, $status: String, $intro: String, $discountRate: Float, $price: Float, $category_id: ID, $img: String, $stock: Int) {
  787. updateproduct: update_product(id: $id recommend: $recommend updatedAt: $updatedAt where: $where unit: $unit name: $name createdAt: $createdAt status: $status intro: $intro discountRate: $discountRate price: $price category_id: $category_id img: $img stock: $stock) {
  788. result
  789. product {
  790. recommend
  791. updatedAt
  792. unit
  793. name
  794. createdAt
  795. status
  796. id
  797. intro
  798. discountRate
  799. price
  800. img
  801. stock
  802. }
  803. }
  804. }
  805. `
  806. const delete_product_by_id = `
  807. mutation deleteproduct($id: ID) {
  808. deleteproduct: delete_product(id: $id)
  809. }
  810. `
  811. const slideshow_by_props = `
  812. query slideshowbyprops($updatedAt: String, $where: slideshow_filter, $sort_by: slideshow_sort_by, $limit: Int, $order_by: OrderBy, $name: String, $createdAt: String, $filter: Filter, $status: Int, $img: String, $skip: Int) {
  813. slideshowbyprops: slideshow_by_props(updatedAt: $updatedAt where: $where sort_by: $sort_by limit: $limit order_by: $order_by name: $name createdAt: $createdAt filter: $filter status: $status img: $img skip: $skip) {
  814. id
  815. name
  816. img
  817. status
  818. }
  819. }
  820. `
  821. const slideshow_by_shop = `
  822. query slideshowbyshop {
  823. slideshowbyshop: shop_by_props {
  824. slideshow
  825. }
  826. }
  827. `
  828. export {
  829. create_user,
  830. find_user_by_openid,
  831. user_by_id,
  832. update_user,
  833. category_by_props,
  834. update_category,
  835. delete_category,
  836. create_category,
  837. productbyprops,
  838. productAndSpec_by_id,
  839. specificationStock_by_props,
  840. update_specificationStock,
  841. create_specificationStock,
  842. delete_specificationStock,
  843. create_userCart,
  844. cart_by_userid,
  845. update_userCart,
  846. delete_userCart_by_id,
  847. create_update_userAddress,
  848. update_userAddress,
  849. userAddressbyprops,
  850. user_default_address,
  851. delete_address,
  852. orderbyprops,
  853. order_by_id,
  854. update_order,
  855. delete_order,
  856. orderProduct_by_props,
  857. create_order,
  858. create_order_product,
  859. shop_by_props,
  860. create_shop,
  861. update_shop,
  862. create_product,
  863. update_product,
  864. delete_product_by_id,
  865. slideshow_by_props,
  866. slideshow_by_shop
  867. }