Hello there, a quick question. How do you guys man...
# orm-help
j
Hello there, a quick question. How do you guys manage to sign up a user with email or username? So the user inputs or the username or an email and a password with that just let him signup. I thought using like a mutation
signup(emailOrUsername: CustomType!, password: String!)
and
customType{data: String!}
and then check in the backend if I should insert as email or username, but do you guys use another method, seems like hacky to me
b
Schema:
Copy code
signup (emailOrUserName: String!, password: String!)
Resolver:
Copy code
if(isemail(emailOrUserName)) {
// validate the email
} else {
// validate the user name
}
It's just my idea fast parrot
j
@bkstorm Yeah that makes sense, don't know why I wanted to create a custom type for that 😂 Anyway that was what i was thinkin on checking on the resolver. Thanks 🙂