import { SyntheticEvent } from 'react' import { useMutation } from '@apollo/react-hooks' import { useFormHandler, TextInput } from '../form/forms' import { USER_SIGNUP } from './graphql' import { userValidation } from './validation' const initialValues = { name: 'Tomi Cvetic', email: 'tomislav.cvetic@u-blox.com', password: '1234', passwordAgain: '1234' } const SignupForm = () => { const { inputProps, values } = useFormHandler(initialValues) const [userSignup, { loading, error }] = useMutation(USER_SIGNUP) return (
{ event.preventDefault() try { const data = await userSignup({ variables: values }) } catch (error) { console.log(error) } }}> ) } export default SignupForm