我想从灯塔库扩展指令@modelClass。我正在研究模块化架构,但我没有 Eloquent 模型,我有几个,而且我正在扩展我的第一个模型版本,这就是为什么我使用接口来绑定我需要的最后一个模型。我需要做的是使用接口而不是模型类来解析我的类型对象。
使用指令 @modelClass 应该如下所示:
type User @modelClass(class: "App\\Models\\versionC\\User") {
id: Int!
username: String!
}
因为我有这个绑定:
$this->app->bind(UserInterface::class, User::class)
我应该有类似的东西:
type User @modelClass(interface: "App\\Interfaces\\UserInterface") {
id: Int!
username: String!
}
但我不能覆盖或扩展 @modelClass 指令。