graphql.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import gql from 'graphql-tag'
  2. const USER_SIGNUP = gql`
  3. mutation USER_SIGNUP($email: String!, $password: String!, $name: String!) {
  4. signup(email: $email, password: $password, name: $name) {
  5. id
  6. email
  7. name
  8. }
  9. }
  10. `
  11. const USER_LOGIN = gql`
  12. mutation USER_LOGIN($email: String!, $password: String!) {
  13. login(email: $email, password: $password) {
  14. id
  15. email
  16. name
  17. }
  18. }
  19. `
  20. const USER_LOGOUT = gql`
  21. mutation USER_LOGOUT {
  22. logout
  23. }
  24. `
  25. const CURRENT_USER = gql`
  26. query CURRENT_USER {
  27. me {
  28. id
  29. email
  30. name
  31. }
  32. }
  33. `
  34. const USER_REQUEST_PASSWORD = gql`
  35. mutation USER_REQUEST_PASSWORD($email: String!) {
  36. userRequestPassword(email: $email)
  37. }
  38. `
  39. const USER_RESET_PASSWORD = gql`
  40. mutation USER_RESET_PASSWORD($key: String!, $password: String!, $passwordAgain: String!) {
  41. userResetPassword(key: $key, password: $password, passwordAgain: $passwordAgain)
  42. }
  43. `
  44. const USER_EDIT = gql`
  45. mutation USER_EDIT($email: String!, $password: String!, $name: String!){
  46. userEdit(email: $email, password: $password, name: $name)
  47. }
  48. `
  49. const USER_DELETE = gql`
  50. mutation USER_DELETE($id: String!) {
  51. userDelete(id: $id)
  52. }
  53. `
  54. export {
  55. USER_SIGNUP,
  56. USER_LOGIN,
  57. USER_LOGOUT,
  58. CURRENT_USER,
  59. USER_REQUEST_PASSWORD,
  60. USER_RESET_PASSWORD,
  61. USER_EDIT,
  62. USER_DELETE
  63. }