graphql.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 {
  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. export {
  50. USER_SIGNUP,
  51. USER_LOGIN,
  52. USER_LOGOUT,
  53. CURRENT_USER,
  54. USER_REQUEST_PASSWORD,
  55. USER_RESET_PASSWORD,
  56. USER_EDIT
  57. }