您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

52 行
728 B

  1. import apollo from "../../lib/apollo.js";
  2. async function GetProduct(token="") {
  3. var res = await apollo.query(
  4. `
  5. query{
  6. products{
  7. id
  8. name
  9. price
  10. description
  11. img{
  12. url
  13. }
  14. business_partner
  15. {
  16. name
  17. }
  18. }
  19. } `,
  20. token
  21. );
  22. return res;
  23. }
  24. async function GetDetailProduct(token="") {
  25. var res = await apollo.query(
  26. `
  27. query{
  28. products
  29. {
  30. name
  31. price
  32. description
  33. img{
  34. url
  35. }
  36. business_partner
  37. {
  38. name
  39. }
  40. }
  41. } `,
  42. token
  43. );
  44. return res;
  45. }
  46. module.exports = {
  47. GetProduct: GetProduct,
  48. GetDetailProduct:GetDetailProduct,
  49. };