25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

267 satır
5.7 KiB

  1. import apollo from "../../lib/apollo.js";
  2. async function GetCarrerS1Yamaha(token="") {
  3. var res = await apollo.query(
  4. `
  5. query {
  6. carrers(where: {category: "S1" business_partner: "1"})
  7. {
  8. id
  9. name
  10. start_regis
  11. until_regis
  12. name_description
  13. }
  14. }`,
  15. token
  16. );
  17. return res;
  18. }
  19. async function GetCarrerD3Yamaha(token="") {
  20. var res = await apollo.query(
  21. `
  22. query {
  23. carrers(where: {category: "D3" business_partner: "1"})
  24. {
  25. id
  26. name
  27. start_regis
  28. until_regis
  29. name_description
  30. }
  31. }`,
  32. token
  33. );
  34. return res;
  35. }
  36. async function GetCarrerSMAYamaha(token="") {
  37. var res = await apollo.query(
  38. `
  39. query {
  40. carrers(where: {category: "SMA" business_partner: "1"})
  41. {
  42. id
  43. name
  44. start_regis
  45. until_regis
  46. name_description
  47. }
  48. }`,
  49. token
  50. );
  51. return res;
  52. }
  53. async function GetDetailCarrer(id, token="") {
  54. var res = await apollo.query(
  55. `
  56. query($input: ID!){
  57. carrers(where:{id:$input})
  58. {
  59. name
  60. description
  61. category
  62. img{
  63. url
  64. }
  65. start_regis
  66. until_regis
  67. name_description
  68. }
  69. }
  70. `,
  71. token,
  72. {
  73. "input": id
  74. }
  75. );
  76. return res;
  77. }
  78. async function GetCarrerS1Suzuki(token="") {
  79. var res = await apollo.query(
  80. `
  81. query {
  82. carrers(where: {category: "S1" business_partner:"2"})
  83. {
  84. id
  85. name
  86. start_regis
  87. until_regis
  88. name_description
  89. }
  90. }`,
  91. token
  92. );
  93. return res;
  94. }
  95. async function GetCarrerD3Suzuki(token="") {
  96. var res = await apollo.query(
  97. `
  98. query {
  99. carrers(where: {category: "D3" business_partner:"2"})
  100. {
  101. id
  102. name
  103. start_regis
  104. until_regis
  105. name_description
  106. }
  107. }`,
  108. token
  109. );
  110. return res;
  111. }
  112. async function GetCarrerSMASuzuki(token="") {
  113. var res = await apollo.query(
  114. `
  115. query {
  116. carrers(where: {category: "SMA" business_partner:"2"})
  117. {
  118. id
  119. name
  120. start_regis
  121. until_regis
  122. name_description
  123. }
  124. }`,
  125. token
  126. );
  127. return res;
  128. }
  129. async function GetCarrerS1Honda(token="") {
  130. var res = await apollo.query(
  131. `
  132. query {
  133. carrers(where: {category: "S1" business_partner:"3"})
  134. {
  135. id
  136. name
  137. start_regis
  138. until_regis
  139. name_description
  140. }
  141. }`,
  142. token
  143. );
  144. return res;
  145. }
  146. async function GetCarrerD3Honda(token="") {
  147. var res = await apollo.query(
  148. `
  149. query {
  150. carrers(where: {category: "D3" business_partner:"3"})
  151. {
  152. id
  153. name
  154. start_regis
  155. until_regis
  156. name_description
  157. }
  158. }`,
  159. token
  160. );
  161. return res;
  162. }
  163. async function GetCarrerSMAHonda(token="") {
  164. var res = await apollo.query(
  165. `
  166. query {
  167. carrers(where: {category: "SMA" business_partner:"3"})
  168. {
  169. id
  170. name
  171. start_regis
  172. until_regis
  173. name_description
  174. }
  175. }`,
  176. token
  177. );
  178. return res;
  179. }
  180. async function GetCarrerS1Hino(token="") {
  181. var res = await apollo.query(
  182. `
  183. query {
  184. carrers(where: {category: "S1" business_partner:"4"})
  185. {
  186. id
  187. name
  188. start_regis
  189. until_regis
  190. name_description
  191. }
  192. }`,
  193. token
  194. );
  195. return res;
  196. }
  197. async function GetCarrerD3Hino(token="") {
  198. var res = await apollo.query(
  199. `
  200. query {
  201. carrers(where: {category: "D3" business_partner:"4"})
  202. {
  203. id
  204. name
  205. start_regis
  206. until_regis
  207. name_description
  208. }
  209. }`,
  210. token
  211. );
  212. return res;
  213. }
  214. async function GetCarrerSMAHino(token="") {
  215. var res = await apollo.query(
  216. `
  217. query {
  218. carrers(where: {category: "SMA" business_partner:"4"})
  219. {
  220. id
  221. name
  222. start_regis
  223. until_regis
  224. name_description
  225. }
  226. }`,
  227. token
  228. );
  229. return res;
  230. }
  231. module.exports = {
  232. //yamaha
  233. GetCarrerS1Yamaha:GetCarrerS1Yamaha,
  234. GetCarrerD3Yamaha:GetCarrerD3Yamaha,
  235. GetCarrerSMAYamaha:GetCarrerSMAYamaha,
  236. //suzuki
  237. GetCarrerS1Suzuki:GetCarrerS1Suzuki,
  238. GetCarrerD3Suzuki:GetCarrerD3Suzuki,
  239. GetCarrerSMASuzuki:GetCarrerSMASuzuki,
  240. //honda
  241. GetCarrerS1Honda:GetCarrerS1Honda,
  242. GetCarrerD3Honda:GetCarrerD3Honda,
  243. GetCarrerSMAHonda:GetCarrerSMAHonda,
  244. //hino
  245. GetCarrerS1Hino:GetCarrerS1Hino,
  246. GetCarrerD3Hino:GetCarrerD3Hino,
  247. GetCarrerSMAHino:GetCarrerSMAHino,
  248. GetDetailCarrer:GetDetailCarrer,
  249. };