在派生对象类型时,我想使用 Sangria 的 AddFields 方法添加一个字段。我不知道如何填写参数“resolve =”有人可以帮助我吗?
给定的是实体交付和系统。我派生了对象类型 SystemD4S。现在我想在派生对象类型中添加一个类型为 SystemD4S 的字段“systemObject”以进行传递。不知道如何填写参数“resolve =”
case class Delivery (
docid: String,
override val docType: String = Doctype.DELIVERY,
system: String,
status: String,
items: List[DeliveryItem],
deleted: Boolean
) extends EntityItemCollection {
def getBusinessKey: String = s"$docid::$docType::$system"
}
case class System(id: String, company: String)
val SystemD4S = deriveObjectType[D4sEntityRepo, System](
ObjectTypeDescription("system"))
val DeliveryD4S = deriveObjectType[D4sEntityRepo, Delivery](
ObjectTypeDescription("delivery"),
AddFields(Field("systemObject", SystemD4S, resolve = c => enitiesD4S.deferRel()))
)