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.

46 lines
818 B

  1. import apollo from "../../lib/apollo.js";
  2. async function profile(token="") {
  3. var res = await apollo.query(
  4. `
  5. query{
  6. users{
  7. username
  8. email
  9. firstName
  10. lastName
  11. telp
  12. address
  13. }
  14. }
  15. `,
  16. token
  17. );
  18. return res;
  19. }
  20. async function GetDetailProfile(id, token = "") {
  21. var res = await apollo.query(
  22. `
  23. query($input: ID!){
  24. products(where:{id:$input})
  25. {
  26. username
  27. email
  28. firstName
  29. lastName
  30. telp
  31. address
  32. }
  33. } `,
  34. token, {
  35. "input": id
  36. }
  37. );
  38. return res;
  39. }
  40. module.exports = {
  41. profile:profile,
  42. GetDetailProfile: GetDetailProfile,
  43. };