Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

54 linhas
906 B

  1. import apollo from "../../lib/apollo.js";
  2. async function GetNews(token="", start = 0) {
  3. var res = await apollo.query(
  4. `
  5. query($start: Int!) {
  6. latestNews(limit:6,start:$start)
  7. {
  8. id
  9. title
  10. description
  11. img{
  12. url
  13. }
  14. published_at
  15. }
  16. }
  17. `,
  18. token,
  19. {
  20. start: start,
  21. }
  22. );
  23. return res;
  24. }
  25. async function GetDetailNews(id, token="") {
  26. var res = await apollo.query(
  27. `
  28. query($input: ID!) {
  29. latestNews(where:{id:$input})
  30. {
  31. id
  32. title
  33. description
  34. img{
  35. url
  36. }
  37. published_at
  38. }
  39. }
  40. `,
  41. token,
  42. {
  43. "input": id
  44. }
  45. );
  46. return res;
  47. }
  48. module.exports = {
  49. GetNews: GetNews,
  50. GetDetailNews: GetDetailNews,
  51. };