import React, { Component } from 'react'; import { Mutation } from 'react-apollo'; import gql from 'graphql-tag'; import Form from './styles/Form'; import Error from './ErrorMessage'; import { CURRENT_USER_QUERY } from './User'; const SIGNIN_MUTATION = gql` mutation SIGNIN_MUTATION($email: String!, $password: String!) { signin(email: $email, password: $password) { id email name } } `; class Signin extends Component { state = { name: '', password: '', email: '', }; saveToState = e => { this.setState({ [e.target.name]: e.target.value }); }; render() { return ( {(signup, { error, loading }) => (
{ e.preventDefault(); await signup(); this.setState({ name: '', email: '', password: '' }); }} >

Sign into your account

)}
); } } export default Signin;