def decodeCursor()

in src/main/scala/com/gu/contentapi/porter/graphql/Edge.scala [73:87]


  def decodeCursor(cursor:Option[String]):Either[String, Seq[Any]] = cursor match {
    case Some(value)=>
      for {
        decoded <- Try { new String(decoder.decode(value)) }.toEither.left.map(_.getMessage)
        parsed <- io.circe.parser.parse(decoded).left.map(_.getMessage())
        result = parsed.asArray match {
          case Some(arr)=>
            arr.map(decodeToAny)
          case _=>
            Nil
        }
      } yield result
    case None=>
      Right(Nil)
  }