graphql.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { gql } from '@apollo/client'
  2. const USERS = gql`
  3. query USERS {
  4. users {
  5. id
  6. email
  7. name
  8. permissions
  9. interests
  10. }
  11. }
  12. `
  13. const USER_SIGNUP = gql`
  14. mutation USER_SIGNUP($email: String!, $password: String!, $name: String!) {
  15. signup(email: $email, password: $password, name: $name) {
  16. id
  17. email
  18. name
  19. }
  20. }
  21. `
  22. const USER_LOGIN = gql`
  23. mutation USER_LOGIN($email: String!, $password: String!) {
  24. login(email: $email, password: $password) {
  25. id
  26. email
  27. name
  28. }
  29. }
  30. `
  31. const USER_LOGOUT = gql`
  32. mutation USER_LOGOUT {
  33. logout
  34. }
  35. `
  36. const CURRENT_USER = gql`
  37. query CURRENT_USER {
  38. me {
  39. id
  40. email
  41. name
  42. permissions
  43. interests
  44. }
  45. }
  46. `
  47. const USER_REQUEST_PASSWORD = gql`
  48. mutation USER_REQUEST_PASSWORD($email: String!) {
  49. requestReset(email: $email)
  50. }
  51. `
  52. const USER_RESET_PASSWORD = gql`
  53. mutation USER_RESET_PASSWORD($token: String!, $password: String!) {
  54. resetPassword(token: $token, password: $password) {
  55. id
  56. name
  57. }
  58. }
  59. `
  60. export {
  61. USERS,
  62. USER_SIGNUP,
  63. USER_LOGIN,
  64. USER_LOGOUT,
  65. CURRENT_USER,
  66. USER_REQUEST_PASSWORD,
  67. USER_RESET_PASSWORD
  68. }