import { useMutation } from '@apollo/client' import React, { FormEvent } from 'react' import { Redirect, Link } from 'react-router-dom' import { REGISTER } from '../../apollo' import { MutationRegisterArgs, ServerAnswer } from '../../apollo/typeDefs.gen' import styles from '../Login/main.module.css' import meme from './meme.jpg' interface IRegisterMutation { register: ServerAnswer } const Register: React.FC = () => { const [doRegister, { data, loading, error }] = useMutation< IRegisterMutation, MutationRegisterArgs >(REGISTER) const handleSubmit = async (e: FormEvent) => { e.preventDefault() const formData = new FormData(e.currentTarget) try { await doRegister({ variables: { email: formData.get('email') as string, name: formData.get('name') as string, }, }) } catch (err) {} } return (
Questionform says: "Is mailbox a password?"

Register / Log In

{loading ? ( 'Loading...' ) : ( )} {error &&

{error.message}

} {data?.register.success && }
) } export default Register