gql.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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. }
  8. }
  9. `
  10. const productbyprops = `
  11. query productbyprops($category_id: ID, $updatedAt: String, $name: String, $createdAt: String, $status: String, $intro: String, $price: Float, $img: String, $stock: Int) {
  12. productbyprops: product_by_props(category_id: $category_id updatedAt: $updatedAt name: $name createdAt: $createdAt status: $status intro: $intro price: $price img: $img stock: $stock) {
  13. category_id{
  14. id
  15. }
  16. updatedAt
  17. unit
  18. name
  19. createdAt
  20. status
  21. id
  22. intro
  23. price
  24. img
  25. stock
  26. }
  27. }
  28. `
  29. const productAndSpec_by_id = `
  30. query productbyid($id: ID) {
  31. productbyid: product_by_id(id: $id) {
  32. category_id{
  33. id
  34. }
  35. updatedAt
  36. unit
  37. name
  38. createdAt
  39. status
  40. id
  41. intro
  42. price
  43. img
  44. stock
  45. }
  46. spec: specificationStock_by_props(product_id: $id ) {
  47. id
  48. color
  49. size
  50. stock
  51. status
  52. }
  53. }
  54. `
  55. const cart_by_userid = `
  56. query findUserCart($user_id:ID){
  57. cartList:userCart_by_props(user_id:$user_id){
  58. count
  59. createdAt
  60. id
  61. product_id{
  62. id
  63. img
  64. intro
  65. name
  66. price
  67. status
  68. stock
  69. unit
  70. }
  71. specificationStock_id{
  72. id
  73. color
  74. size
  75. stock
  76. status
  77. }
  78. }
  79. }
  80. `
  81. const delete_userCart_by_id = `
  82. mutation delete_userCart($id: [String]) {
  83. delete_userCart(where: {
  84. id: {
  85. _in: $id
  86. }
  87. })
  88. }
  89. `
  90. const userAddressbyprops = `
  91. query userAddressbyprops($user_id: ID) {
  92. userAddressbyprops: userAddress_by_props(user_id: $user_id) {
  93. address
  94. updatedAt
  95. telephone
  96. default
  97. city
  98. username
  99. postcode
  100. createdAt
  101. deletedAt
  102. id
  103. user_id {
  104. email
  105. telephone
  106. username
  107. openid
  108. id
  109. }
  110. area
  111. province
  112. }
  113. }
  114. `
  115. const user_default_address = `
  116. query user_default_address($user_id: ID, $default: Int) {
  117. defaultAddress: userAddress_by_props(user_id: $user_id default: $default) {
  118. id
  119. default
  120. username
  121. telephone
  122. province
  123. area
  124. city
  125. address
  126. user_id {
  127. openid
  128. id
  129. }
  130. }
  131. }
  132. `
  133. const orderbyprops = `
  134. 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) {
  135. 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) {
  136. deliveryTime
  137. updatedAt
  138. orderLogistics_id {
  139. updatedAt
  140. logisticsFee
  141. expressId
  142. createdAt
  143. consigneeTel
  144. id
  145. consignAddress
  146. LogisticsStatus
  147. consigneeName
  148. }
  149. payTime
  150. orderTotalPay
  151. createdAt
  152. orderStatus
  153. userAddress_id {
  154. address
  155. updatedAt
  156. telephone
  157. default
  158. city
  159. username
  160. postcode
  161. createdAt
  162. deletedAt
  163. id
  164. area
  165. province
  166. }
  167. id
  168. orderShipFee
  169. count
  170. productTotalPay
  171. orderPay_id {
  172. id
  173. totalPay
  174. transactionId
  175. payTime
  176. }
  177. }
  178. }
  179. `
  180. const orderProduct_by_props = `
  181. query orderProductbyprops($order_id: ID) {
  182. orderProductbyprops: orderProduct_by_props(order_id: $order_id) {
  183. updatedAt
  184. productColor
  185. unit
  186. product_id {
  187. updatedAt
  188. unit
  189. name
  190. createdAt
  191. status
  192. id
  193. intro
  194. price
  195. img
  196. stock
  197. }
  198. productSize
  199. orderPay
  200. createdAt
  201. productImg
  202. productName
  203. productPrice
  204. id
  205. count
  206. productPay
  207. }
  208. }
  209. `
  210. const create_order = `
  211. mutation createorder($deliveryTime: String, $remark: String, $updatedAt: String, $orderLogistics_id: ID, $payTime: String, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID!, $orderShipFee: Float, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID,
  212. $deleteId: [String]) {
  213. createorder: create_order(deliveryTime: $deliveryTime remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id payTime: $payTime orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id orderShipFee: $orderShipFee count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
  214. result
  215. order {
  216. deliveryTime
  217. remark
  218. updatedAt
  219. orderLogistics_id {
  220. updatedAt
  221. logisticsFee
  222. expressId
  223. createdAt
  224. consigneeTel
  225. id
  226. consignAddress
  227. LogisticsStatus
  228. consigneeName
  229. }
  230. payTime
  231. orderTotalPay
  232. createdAt
  233. orderStatus
  234. userAddress_id {
  235. address
  236. updatedAt
  237. telephone
  238. default
  239. city
  240. username
  241. postcode
  242. createdAt
  243. deletedAt
  244. id
  245. area
  246. province
  247. }
  248. id
  249. orderShipFee
  250. count
  251. productTotalPay
  252. orderPay_id {
  253. id
  254. totalPay
  255. transactionId
  256. payTime
  257. }
  258. }
  259. }
  260. delete_userCart(where: {
  261. id: {
  262. _in: $deleteId
  263. }
  264. })
  265. }
  266. `
  267. const create_order_product = `
  268. 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) {
  269. 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) {
  270. result
  271. orderProduct {
  272. updatedAt
  273. productColor
  274. unit
  275. productSize
  276. orderPay
  277. createdAt
  278. productImg
  279. productName
  280. productPrice
  281. id
  282. count
  283. productPay
  284. }
  285. }
  286. }
  287. `
  288. const shop_by_props = `
  289. query shopbyprops($limit: Int) {
  290. shopbyprops: shop_by_props(limit: $limit) {
  291. description
  292. address
  293. updatedAt
  294. telephone
  295. name
  296. createdAt
  297. status
  298. id
  299. slideshow
  300. notice
  301. intro
  302. img
  303. }
  304. }
  305. `
  306. const update_shop = `
  307. 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) {
  308. 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) {
  309. result
  310. shop {
  311. description
  312. address
  313. updatedAt
  314. telephone
  315. name
  316. createdAt
  317. status
  318. id
  319. slideshow
  320. notice
  321. intro
  322. img
  323. }
  324. }
  325. }
  326. `
  327. const create_shop = `
  328. 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) {
  329. 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) {
  330. result
  331. shop {
  332. description
  333. address
  334. updatedAt
  335. telephone
  336. name
  337. createdAt
  338. status
  339. id
  340. slideshow
  341. notice
  342. intro
  343. img
  344. }
  345. }
  346. }
  347. `
  348. export {
  349. category_by_props,
  350. productbyprops,
  351. productAndSpec_by_id,
  352. cart_by_userid,
  353. delete_userCart_by_id,
  354. userAddressbyprops,
  355. user_default_address,
  356. orderbyprops,
  357. orderProduct_by_props,
  358. create_order,
  359. create_order_product,
  360. shop_by_props,
  361. create_shop,
  362. update_shop
  363. }