0

I'm following official Lighthouse documentation on how to setup GraphQl into my project. Unfortunately, I'm stacked with the following error:

No directive found for `bcrypt`

Following schema I have created so far:


type Query {
    users: [User!]! @paginate(defaultCount: 10)
    user(id: ID @eq): User @find
}

type User {
    id: ID!
    name: String!
    email: String!
    created_at: DateTime!
    updated_at: DateTime!
}

type Mutation {
    createUser(
        name: String!,
        email: String! @rules(apply: ["email", "unique:users"])
        password: String! @bcrypt
    ): User @create
}

The query I'm trying to execute is following:

mutation {
  createUser(
    name:"John Doe"
    email:"john@test.com"
    password: "somesupersecret"
  ) {
    id
    email
  }
}
Aleksandr Popov
  • 500
  • 5
  • 20

1 Answers1

5

Okay dug up - there is no more @brypt directory in \vendor\nuwave\lighthouse\src\Schema\Directives\ instead, there is @hash directive which is working like a charm and uses driver you specify in config/hashing.php configuration file

Aleksandr Popov
  • 500
  • 5
  • 20