graphql.js 639 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. export { USER_SIGNUP, USER_LOGIN, USER_LOGOUT, CURRENT_USER }