如何修复Laravel Lighthouse中的“找不到wherewhereHasConditions的指令”?

问题描述

我正在使用"nuwave/lighthouse": "^4.14",并具有基于the docs of this feature的schema.graphql:

type Query {
    # ...
    postsWithUnseenComments(orderBy: _ @orderBy(columns: ["id","created_at"],order: ASC),hasComments: _ @whereHasConditions(columns: ["user_id","seen_at"])): [Post!]! @paginate(defaultCount: 20) @cache
}

我得到这个错误:

No directive found for `whereHasConditions` {"exception":"[object] (Nuwave\\Lighthouse\\Exceptions\\DirectiveException(code: 0): No directive found for `whereHasConditions` at C:\\code\\myproject\\vendor\
uwave\\lighthouse\\src\\Schema\\Factories\\DirectiveFactory.php:91)

我已经尝试过here中的php artisan package:discover,但没有帮助。

我从the docs知道应该vendor\nuwave\lighthouse\src\WhereConditions\WhereHasConditionsDirective.php自动加载。

@spawnia,非常感谢您提供的出色库。对于我做错事情的任何提示,我将不胜感激。谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)