You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
786 B

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