sangria-graphql/sangria

Add deriveInterfaceType

Ouverte

#263 ouverte le 8 juil. 2017

 (2 commentaires) (0 réaction) (0 personne assignée)Scala (219 forks)batch import
derive-macrosfeaturehelp wanted

Métriques du dépôt

Stars
 (1 961 étoiles)
Métriques de merge PR
 (Merge moyen 8j 15h) (4 PRs mergées en 30 j)

Description

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

Guide contributeur