没有找到 `bcrypt` 的指令

No directive found for `bcrypt`

我正在关注有关如何将 GraphQl 设置到我的项目中的官方 Lighthouse 文档。 不幸的是,我遇到了以下错误:

No directive found for `bcrypt`

我目前创建的架构如下:


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
}

我要执行的查询如下:

mutation {
  createUser(
    name:"John Doe"
    email:"john@test.com"
    password: "somesupersecret"
  ) {
    id
    email
  }
}

好的,找到了 - \vendor\nuwave\lighthouse\src\Schema\Directives\ 中不再有 @brypt 目录,取而代之的是 @hash 指令,它工作得很好,并使用您在 [= 中指定的驱动程序12=]配置文件