diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-05-24 15:19:21 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-05-24 15:19:21 -0400 |
| commit | 072eca0e5038a7755ca9b2c94dfe1a0c3f110968 (patch) | |
| tree | a6c54e1503baf665ad0eeaeaad6d2a2b7ba3ba39 /frontend/components/Signup.js | |
| parent | b294a6fa500b165aae86afbad5fce49a02314b0d (diff) | |
colocate queries and components
Diffstat (limited to 'frontend/components/Signup.js')
| -rw-r--r-- | frontend/components/Signup.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/frontend/components/Signup.js b/frontend/components/Signup.js index 624bc10..9164e67 100644 --- a/frontend/components/Signup.js +++ b/frontend/components/Signup.js @@ -1,14 +1,25 @@ import React, { Component } from 'react'; import { Mutation } from 'react-apollo'; -import { SIGNUP_MUTATION, CURRENT_USER_QUERY } from '../queries/queries.graphql'; +import gql from 'graphql-tag'; +import { CURRENT_USER_QUERY } from './User'; import Form from './styles/Form'; import Error from './ErrorMessage'; +const SIGNUP_MUTATION = gql` + mutation SIGNUP_MUTATION($email: String!, $name: String!, $password: String!) { + signup(email: $email, name: $name, password: $password) { + id + email + name + } + } +`; + class Signup extends Component { state = { - email: `wesbos@gmail.com`, - name: 'Wes Bos', - password: 'wes', + email: '', + name: '', + password: '', }; saveToState = e => { @@ -79,3 +90,4 @@ class Signup extends Component { } export default Signup; +export { SIGNUP_MUTATION }; |
