Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error on register form "Cannot read property 'username' of undefined. #35

Closed
ghost opened this issue Aug 3, 2021 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Aug 3, 2021

45 | name="username"
46 | type="text"
47 | value={values.username}

48 | error={errors.username ? true : false}
49 | onChange={onChange}
50 | />
51 | <Form.Input

so I know 'errors' is undefined.

const [addUser, {loading}] = useMutation(REGISTER_USER, { update(_, result){ console.log(result) props.history.push('/') }, onError(err){ console.log(err.graphQLErrors[0].extensions.exception.errors) setErrors(err.graphQLErrors[0].extensions.exception.errors) }, variables: values })
this is where we set the error property, right? Is it not setting it correctly? is there an updated way for graphql to set errors?

@ghost ghost closed this as completed Aug 3, 2021
@ghost
Copy link
Author

ghost commented Aug 3, 2021

figured it out. Maybe its an update but it should not include "exception"

@meganlynn21
Copy link

THANK YOU been trying to figure this out lol

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant