gql.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. const productbyprops = `
  2. query productbyprops($category: String, $updatedAt: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
  3. productbyprops: product_by_props(category: $category updatedAt: $updatedAt name: $name createdAt: $createdAt status: $status intro: $intro price: $price img: $img stock: $stock) {
  4. category
  5. updatedAt
  6. unit
  7. name
  8. createdAt
  9. status
  10. id
  11. intro
  12. price
  13. img
  14. stock
  15. }
  16. }
  17. `
  18. const productbyid = `
  19. query productbyid($id: ID) {
  20. productbyid: product_by_id(id: $id) {
  21. category
  22. updatedAt
  23. unit
  24. name
  25. createdAt
  26. status
  27. id
  28. intro
  29. price
  30. img
  31. stock
  32. }
  33. }
  34. `
  35. const cart_by_userid = `
  36. query findUserCart($user_id:ID){
  37. cartList:userCart_by_props(user_id:$user_id){
  38. count
  39. createdAt
  40. id
  41. product_id{
  42. category
  43. createdAt
  44. img
  45. intro
  46. name
  47. price
  48. status
  49. stock
  50. unit
  51. updatedAt
  52. }
  53. }
  54. }
  55. `
  56. const delete_userCart_by_id = `
  57. mutation($id: [String]) {
  58. delete_userCart(where: {
  59. id: {
  60. _in: $id
  61. }
  62. })
  63. }
  64. `
  65. const userAddressbyprops = `
  66. query userAddressbyprops($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) {
  67. userAddressbyprops: userAddress_by_props(address: $address updatedAt: $updatedAt telephone: $telephone
  68. default: $default city: $city username: $username postcode: $postcode createdAt: $createdAt deletedAt: $deletedAt user_id: $user_id area: $area province: $province) {
  69. address
  70. updatedAt
  71. telephone
  72. default
  73. city
  74. username
  75. postcode
  76. createdAt
  77. deletedAt
  78. id
  79. user_id {
  80. email
  81. updatedAt
  82. password
  83. telephone
  84. username
  85. createdAt
  86. openid
  87. id
  88. }
  89. area
  90. province
  91. }
  92. }
  93. `
  94. const orderbyprops = `
  95. query orderbyprops($deliveryTime: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
  96. orderbyprops: order_by_props(deliveryTime: $deliveryTime updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  97. deliveryTime
  98. updatedAt
  99. orderLogistics_id {
  100. updatedAt
  101. logisticsFee
  102. expressId
  103. createdAt
  104. consigneeTel
  105. id
  106. consignAddress
  107. LogisticsStatus
  108. consigneeName
  109. }
  110. payTime
  111. orderTotalPay
  112. createdAt
  113. orderStatus
  114. userAddress_id {
  115. address
  116. updatedAt
  117. telephone
  118. default
  119. city
  120. username
  121. postcode
  122. createdAt
  123. deletedAt
  124. id
  125. area
  126. province
  127. }
  128. id
  129. orderShipFee
  130. count
  131. productTotalPay
  132. orderPay_id {
  133. id
  134. totalPay
  135. transactionId
  136. payTime
  137. }
  138. }
  139. }
  140. `
  141. export {
  142. productbyprops,
  143. productbyid,
  144. cart_by_userid,
  145. delete_userCart_by_id,
  146. userAddressbyprops,
  147. orderbyprops
  148. }