Newer
Older
miracle-tv-backend / src / main / scala / sangria / GraphQLRequest.scala
@Илья Панфёров Илья Панфёров on 19 Jul 442 bytes feat: initial commit
package sangria.http.pekko

import sangria.ast.Document

case class GraphQLRequest[T](query: Document, variables: T, operationName: Option[String])

object GraphQLRequest {
  def apply[T](query: Document, variables: Option[T], operationName: Option[String])(implicit v: Variables[T]): GraphQLRequest[T] =
    new GraphQLRequest(
      query = query,
      variables = variables.fold(v.empty)(identity),
      operationName = operationName)
}