Skip to content

Commit

Permalink
Fix Scala 3 compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdogpr committed May 14, 2024
1 parent 252110c commit 0e11746
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import caliban.client.Operations.IsOperation
import caliban.client.SelectionBuilder
import com.devsisters.shardcake.internal.GraphQLClient
import com.devsisters.shardcake.internal.GraphQLClient.PodAddressInput
import sttp.capabilities.WebSockets
import sttp.capabilities.zio.ZioStreams
import sttp.client3.SttpBackend
import sttp.client3.asynchttpclient.zio.AsyncHttpClientZioBackend
import zio.{ Config => _, _ }
Expand All @@ -26,10 +24,10 @@ object ShardManagerClient {
* A layer that returns a client for the Shard Manager API.
* It requires an sttp backend. If you don't want to use your own backend, simply use `liveWithSttp`.
*/
val live: ZLayer[Config with SttpBackend[Task, ZioStreams with WebSockets], Nothing, ShardManagerClientLive] =
val live: ZLayer[Config with SttpBackend[Task, Any], Nothing, ShardManagerClientLive] =
ZLayer {
for {
sttpClient <- ZIO.service[SttpBackend[Task, ZioStreams with WebSockets]]
sttpClient <- ZIO.service[SttpBackend[Task, Any]]
config <- ZIO.service[Config]
} yield new ShardManagerClientLive(sttpClient, config)
}
Expand Down Expand Up @@ -58,10 +56,7 @@ object ShardManagerClient {
}
}

class ShardManagerClientLive(
sttp: SttpBackend[Task, ZioStreams with WebSockets],
config: Config
) extends ShardManagerClient {
class ShardManagerClientLive(sttp: SttpBackend[Task, Any], config: Config) extends ShardManagerClient {
private def send[Origin: IsOperation, A](query: SelectionBuilder[Origin, A]): Task[A] =
sttp.send(query.toRequest(config.shardManagerUri)).map(_.body).absolve

Expand Down

0 comments on commit 0e11746

Please sign in to comment.