You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

310 lines
4.7 KiB

  1. import apollo from "../../lib/apollo.js";
  2. // async function GetProduct(token="", start = 0) {
  3. // var res = await apollo.query(
  4. // `
  5. // query($start: Int!) {
  6. // products(limit:1,start:$start)
  7. // {
  8. // id
  9. // name
  10. // price
  11. // description
  12. // img{
  13. // url
  14. // }
  15. // business_partner
  16. // {
  17. // name
  18. // }
  19. // }
  20. // }`,
  21. // token,
  22. // {
  23. // start: start,
  24. // }
  25. // );
  26. // return res;
  27. // }
  28. async function GetDetailProduct(token="") {
  29. var res = await apollo.query(
  30. `
  31. query{
  32. products
  33. {
  34. name
  35. price
  36. description
  37. img{
  38. url
  39. }
  40. business_partner
  41. {
  42. name
  43. }
  44. overview
  45. specification
  46. accessories
  47. film{
  48. url
  49. }
  50. }
  51. } `,
  52. token
  53. );
  54. return res;
  55. }
  56. async function GetProductYamaha(token="") {
  57. var res = await apollo.query(
  58. `
  59. query {
  60. products(where: {business_partner: "1"})
  61. {
  62. id
  63. name
  64. description
  65. price
  66. img{
  67. url
  68. }
  69. business_partner
  70. {
  71. name
  72. }
  73. overview
  74. specification
  75. accessories
  76. film{
  77. url
  78. }
  79. }
  80. }`,
  81. token
  82. );
  83. return res;
  84. }
  85. async function GetProductSuzuki(token="") {
  86. var res = await apollo.query(
  87. `
  88. query {
  89. products(where: {business_partner: "2"})
  90. {
  91. id
  92. name
  93. description
  94. price
  95. img{
  96. url
  97. }
  98. business_partner
  99. {
  100. name
  101. }
  102. overview
  103. specification
  104. accessories
  105. film{
  106. url
  107. }
  108. }
  109. }`,
  110. token
  111. );
  112. return res;
  113. }
  114. async function GetProductHonda(token="") {
  115. var res = await apollo.query(
  116. `
  117. query {
  118. products(where: {business_partner: "3"})
  119. {
  120. id
  121. name
  122. description
  123. price
  124. img{
  125. url
  126. }
  127. business_partner
  128. {
  129. name
  130. }
  131. overview
  132. specification
  133. accessories
  134. film{
  135. url
  136. }
  137. }
  138. }`,
  139. token
  140. );
  141. return res;
  142. }
  143. async function GetProductHino(token="") {
  144. var res = await apollo.query(
  145. `
  146. query {
  147. products(where: {business_partner: "4"})
  148. {
  149. id
  150. name
  151. description
  152. price
  153. img{
  154. url
  155. }
  156. business_partner
  157. {
  158. name
  159. }
  160. overview
  161. specification
  162. accessories
  163. film{
  164. url
  165. }
  166. }
  167. }`,
  168. token
  169. );
  170. return res;
  171. }
  172. async function GetProductMercedes(token="") {
  173. var res = await apollo.query(
  174. `
  175. query {
  176. products(where: {business_partner: "5"})
  177. {
  178. id
  179. name
  180. description
  181. price
  182. img{
  183. url
  184. }
  185. business_partner
  186. {
  187. name
  188. }
  189. overview
  190. specification
  191. accessories
  192. film{
  193. url
  194. }
  195. }
  196. }`,
  197. token
  198. );
  199. return res;
  200. }
  201. async function GetProductBPR(token="") {
  202. var res = await apollo.query(
  203. `
  204. query {
  205. products(where: {business_partner: "6"})
  206. {
  207. id
  208. name
  209. description
  210. price
  211. img{
  212. url
  213. }
  214. business_partner
  215. {
  216. name
  217. }
  218. overview
  219. specification
  220. accessories
  221. film{
  222. url
  223. }
  224. }
  225. }`,
  226. token
  227. );
  228. return res;
  229. }
  230. async function GetProductEmilia(token="") {
  231. var res = await apollo.query(
  232. `
  233. query {
  234. products(where: {business_partner: "8"})
  235. {
  236. id
  237. name
  238. description
  239. price
  240. img{
  241. url
  242. }
  243. business_partner
  244. {
  245. name
  246. }
  247. overview
  248. specification
  249. accessories
  250. film{
  251. url
  252. }
  253. }
  254. }`,
  255. token
  256. );
  257. return res;
  258. }
  259. async function GetProductHomes(token="") {
  260. var res = await apollo.query(
  261. `
  262. query {
  263. products(where: {business_partner: "9"})
  264. {
  265. id
  266. name
  267. description
  268. price
  269. img{
  270. url
  271. }
  272. business_partner
  273. {
  274. name
  275. }
  276. overview
  277. specification
  278. accessories
  279. film{
  280. url
  281. }
  282. }
  283. }`,
  284. token
  285. );
  286. return res;
  287. }
  288. module.exports = {
  289. // GetProduct: GetProduct,
  290. GetDetailProduct:GetDetailProduct,
  291. GetProductYamaha:GetProductYamaha,
  292. GetProductSuzuki:GetProductSuzuki,
  293. GetProductHonda:GetProductHonda,
  294. GetProductHino:GetProductHino,
  295. GetProductMercedes:GetProductMercedes,
  296. GetProductBPR:GetProductBPR,
  297. GetProductEmilia:GetProductEmilia,
  298. GetProductHomes:GetProductHomes,
  299. };