Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

100 righe
2.1 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. description
  11. img{
  12. url
  13. }
  14. start_regis
  15. until_regis
  16. name_description
  17. }
  18. }`,
  19. token
  20. );
  21. return res;
  22. }
  23. async function GetCarrerD3(token="") {
  24. var res = await apollo.query(
  25. `
  26. query {
  27. carrers(where: {category: "D3"})
  28. {
  29. id
  30. name
  31. description
  32. img{
  33. url
  34. }
  35. start_regis
  36. until_regis
  37. name_description
  38. }
  39. }`,
  40. token
  41. );
  42. return res;
  43. }
  44. async function GetCarrerSMA(token="") {
  45. var res = await apollo.query(
  46. `
  47. query {
  48. carrers(where: {category: "SMA"})
  49. {
  50. id
  51. name
  52. description
  53. img{
  54. url
  55. }
  56. start_regis
  57. until_regis
  58. name_description
  59. }
  60. }`,
  61. token
  62. );
  63. return res;
  64. }
  65. async function GetDetailCarrer(id, token="") {
  66. var res = await apollo.query(
  67. `
  68. query($input: ID!){
  69. carrers(where:{id:$input})
  70. {
  71. name
  72. description
  73. category
  74. img{
  75. url
  76. }
  77. start_regis
  78. until_regis
  79. name_description
  80. }
  81. }
  82. `,
  83. token,
  84. {
  85. "input": id
  86. }
  87. );
  88. return res;
  89. }
  90. module.exports = {
  91. GetCarrerS1:GetCarrerS1,
  92. GetCarrerD3:GetCarrerD3,
  93. GetCarrerSMA:GetCarrerSMA,
  94. GetDetailCarrer:GetDetailCarrer,
  95. };