summaryrefslogtreecommitdiffstats
path: root/frontend/components/Signin.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/components/Signin.js')
-rw-r--r--frontend/components/Signin.js21
1 files changed, 17 insertions, 4 deletions
diff --git a/frontend/components/Signin.js b/frontend/components/Signin.js
index 23a5835..53cdb76 100644
--- a/frontend/components/Signin.js
+++ b/frontend/components/Signin.js
@@ -1,14 +1,26 @@
import React, { Component } from 'react';
-import { Mutation, ApolloConsumer } from 'react-apollo';
-import { SIGNIN_MUTATION, CURRENT_USER_QUERY } from '../queries/queries.graphql';
+import { Mutation } from 'react-apollo';
+import gql from 'graphql-tag';
+import { CURRENT_USER_QUERY } from './User';
import Error from './ErrorMessage';
import Form from './styles/Form';
+const SIGNIN_MUTATION = gql`
+ mutation SIGNIN_MUTATION($email: String!, $password: String!) {
+ signin(email: $email, password: $password) {
+ id
+ email
+ name
+ }
+ }
+`;
+
class Signin extends Component {
state = {
- email: `wesbos@gmail.com`,
- password: 'abc123',
+ email: '',
+ password: '',
};
+
saveToState = e => {
const { name, value } = e.target;
this.setState({ [name]: value });
@@ -64,3 +76,4 @@ class Signin extends Component {
}
export default Signin;
+export { SIGNIN_MUTATION };