Skip to content

COMPILE ERROR at end of Deferred Resolvers #1

@8bitreid

Description

@8bitreid

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions