All Downloads are FREE. Search and download functionalities are using the official Maven repository.

caliban.client.ws.GraphQLWSResponse.scala Maven / Gradle / Ivy

There is a newer version: 1.3.3.4
Show newest version
package caliban.client.ws

import io.circe.{ Decoder, HCursor, Json }

case class GraphQLWSResponse(`type`: String, id: Option[String], payload: Option[Json])

object GraphQLWSResponse {
  implicit val graphQLWSResponseEncoder: Decoder[GraphQLWSResponse] = (c: HCursor) =>
    for {
      t       <- c.downField("type").as[String]
      id      <- c.downField("id").as[Option[String]]
      payload <- c.downField("payload").as[Option[Json]]
    } yield GraphQLWSResponse(t, id, payload)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy