def buildHydrateQueries()

in fapi-client/src/main/scala/com/gu/facia/api/contentapi/ContentApi.scala [27:34]


  def buildHydrateQueries(client: ContentApiClient, ids: List[String], adjustSearchQuery: AdjustSearchQuery = identity, itemQueries: ItemQueries = ItemQueries): Response[Seq[SearchQuery]] = {
    Try(IdsSearchQueries.makeBatches(ids)) match {
        case Success(Some(batches)) =>
          Response.Right(batches.map(adjustSearchQuery compose itemQueries.queryForIds))
        case _ =>
          Response.Left(UrlConstructError("Unable to construct url for ids search query (the constructed URL for a " +
            s"single ID must be too long!): ${ids.mkString(", ")}"))}
  }