I’m working on an app using 8Base Users with Auth0. Login and registration is all possible and I can make any changes from the dashboard successfully.
One thing that I am trying to do from a React / GraphQL based app is write a mutation that will create a user with a pre-defined user role that I created in the 8Base dashboard. Right now, any user that signs up has “Guest” and “Administrator” by default, but I added an additional role called “Member”.
What would the mutation look like for a user that has the “Member” role? Here’s what I have so far with my User table having a Roles column (currently associated with Users table because I don’t know what else to try):
mutation SignUp(
$email: String!
$firstName: String!
$lastName: String
$password: String!
$authProfileId: ID!
$roleId: ID!
) {
userSignUpWithPassword(
user: {
email: $email
firstName: $firstName
lastName: $lastName
roles: { connect: [{ id: $roleId }] }
}
password: $password
authProfileId: $authProfileId
) {
id
email
createdAt
}
}