Hey guys, sorry if this question is too dumb :slig...
# prisma-whats-new
a
Hey guys, sorry if this question is too dumb 🙂 but I just added a user via the console like so:
Copy code
mutation {
  createUser(authProvider: {
    email: {
      email: "<mailto:email@email.com|email@email.com>"
      password: "secret-password"
    }
  }
  	name: "This Guy"
  ) {
    id
    name
  }
}
How do I make this into a mutation that I can use in code? eg, this way:
Copy code
const addMutation = gql\`
  mutation addPost($description: String!, $imageUrl: String!) {
    createPost(description: $description, imageUrl: $imageUrl) {
      id
      description
      imageUrl
    }
  }
\`
The Auth provider is confusing me
k
@aabreu Hey, here's what I'm using and it seems to work. I'm quite green at it as well, though.
Copy code
const createUser = gql`
  mutation (
    $name: String!,
    $email: String!,
    $password: String!) {
      createUser(
        authProvider: {email: {email: $email, password: $password}}
        name: $name) {
          id
          name
      }
    }
`
a
Thanks so much guys, I was really really close, but those resources helped me wrap my head around it! 🙂
👍 1