Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ArgBuilders for Seq, Set and Vector #304

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/src/main/scala/caliban/schema/ArgBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ object ArgBuilder {
case other => ev.build(other).map(List(_))
}

implicit def seq[A](implicit ev: ArgBuilder[A]): ArgBuilder[Seq[A]] = list[A].map(_.toSeq)
implicit def set[A](implicit ev: ArgBuilder[A]): ArgBuilder[Set[A]] = list[A].map(_.toSet)
implicit def vector[A](implicit ev: ArgBuilder[A]): ArgBuilder[Vector[A]] = list[A].map(_.toVector)

type EitherExecutionError[A] = Either[ExecutionError, A]

implicit val eitherMonadic: Monadic[EitherExecutionError] = new Monadic[EitherExecutionError] {
Expand Down