sangria-graphql/sangria

Add deriveInterfaceType

オープン

#263 opened on 2017/07/08

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Scala (219 件のフォーク)batch import
derive-macrosfeaturehelp wanted

Repository metrics

Stars
 (1,961 個のスター)
PR merge metrics
 (平均マージ 8d 15h) (30d で 4 merged PRs)

説明

Would be cool to have this for traits

trait MyInterface {
  def id: Int
  name: String
}
val MyInterfaceType = deriveInterfaceType[Unit, MyInterface]()

I think that another solution that is closer to deriveObjectType could be

case class MyInterfaceImpl(id: Int, name: String) extends MyInterface
val MyInterfaceType = deriveInterfaceType[Unit, MyInterfaceImpl](InterfaceTypeName("MyInterface"))

This would help because you don't have to copy & paste the field names into another definition

コントリビューターガイド