graphql.js 633 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import gql from 'graphql-tag'
  2. const USER_LOGIN = gql`
  3. mutation USER_LOGIN($email: String!, $password: String!) {
  4. login(email: $email, password: $password) {
  5. id
  6. email
  7. name
  8. }
  9. }
  10. `
  11. const USER_LOGOUT = gql`
  12. mutation USER_LOGOUT {
  13. logout {
  14. id
  15. }
  16. }
  17. `
  18. const USER_SIGNUP = gql`
  19. mutation USER_SIGNUP($email: String!, $password: String!, $name: String!) {
  20. signup(email: $email, password: $password, name: $name) {
  21. id
  22. }
  23. }
  24. `
  25. const CURRENT_USER = gql`
  26. query {
  27. me {
  28. id
  29. email
  30. name
  31. }
  32. }
  33. `
  34. export { USER_LOGIN, USER_LOGOUT, USER_SIGNUP, CURRENT_USER }