選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

88 行
1.8 KiB

  1. import apollo from "../../lib/apollo.js";
  2. async function GetCarrerS1(token="") {
  3. var res = await apollo.query(
  4. `
  5. query {
  6. carrers(where: {category: "S1"})
  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 GetCarrerD3(token="") {
  20. var res = await apollo.query(
  21. `
  22. query {
  23. carrers(where: {category: "D3"})
  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 GetCarrerSMA(token="") {
  37. var res = await apollo.query(
  38. `
  39. query {
  40. carrers(where: {category: "SMA"})
  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. module.exports = {
  79. GetCarrerS1:GetCarrerS1,
  80. GetCarrerD3:GetCarrerD3,
  81. GetCarrerSMA:GetCarrerSMA,
  82. GetDetailCarrer:GetDetailCarrer,
  83. };