Suggested code currently does not compile.
package com.howtographql.scala.sangria
import sangria.execution.deferred.HasId
package object models {
case class Link(id: Int, url: String, description: String)
object Link {
implicit val hasId: HasId[Link, Int] = HasId[Link, Int](_.id)
}
}
It appears later in the tutorial you add this:
trait Identifiable {
val id: Int
}
object Identifiable {
implicit def hasId[T <: Identifiable]: HasId[T, Int] = HasId(_.id)
}
Error seen
Error:(17, 41) value tupled is not a member of object com.howtographql.scala.sangria.models.package.Link
def * = (id, url, description).mapTo[Link]
Reference
|
implicit def hasId[T <: Identifiable]: HasId[T, Int] = HasId(_.id) |
Suggested code currently does not compile.
It appears later in the tutorial you add this:
Error seen
Reference
howtographql_tutorial_code/src/main/scala/com/howtographql/scala/sangria/models/package.scala
Line 14 in fc3086d