问题描述
我有一个GraphQL查询findRecipe
,它返回一个口才模型recipe
的数组,该数组也在模式中定义。 recipe
有一个名为is_special_recipe
的字段,它不是数据库中的列,而是由方法计算出的值。如何在is_special_recipe
查询中过滤findRecipe
?
searchRecipe(
name: String @where(operator: "LIKE")
cooking_time_min: Int @where(operator: ">=")
cooking_time_max: Int @where(operator: "<=")
is_special_recipe: Boolean @where(operator: "eq")
): [Recipe] @paginate
type Recipe {
id: ID!
name: String!
image: String
description: String
cooking_time_min: Int
cooking_time_max: Int
is_special_recipe: Boolean @method(name: "isspecialRecipe")
}
public function isspecialRecipe()
{
//some logic
return false || true;
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)