graphql.js 569 B

123456789101112131415161718192021222324252627282930
  1. import { mutation } from 'react-apollo'
  2. import gql from 'graphql-tag'
  3. const USER_LOGIN = gql`
  4. mutation USER_LOGIN($email: String!, $password: String!) {
  5. login(email: $email, password: $password) {
  6. id
  7. email
  8. name
  9. }
  10. }
  11. `
  12. const USER_LOGOUT = gql`
  13. mutation USER_LOGOUT {
  14. logout {
  15. id
  16. }
  17. }
  18. `
  19. const USER_SIGNUP = gql`
  20. mutation USER_SIGNUP($email: String!, $password: String!, $name: String!) {
  21. signup(email: $email, password: $password, name: $name) {
  22. id
  23. }
  24. }
  25. `
  26. export { USER_LOGIN, USER_LOGOUT, USER_SIGNUP }