Skip to content

Commit

Permalink
try to reproduce issue #1041
Browse files Browse the repository at this point in the history
  • Loading branch information
yanns committed Nov 7, 2024
1 parent 90c0b9d commit 733e80c
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,20 @@ object IOExecutionSchemeSpec {
() =>
fields[Unit, Unit](
Field("ids", ListType(IntType), resolve = _ => List(1, 2)),
Field("parent", StringType, resolve = _ => IO("hello"))
))
Field(
"parent",
StringType,
resolve = { _ =>
(for {
value <- IO(Option("hello"))
} yield value match {
case Some(value) => IO.pure(value)
case None => IO.raiseError(new Exception("No value"))
}).flatten: IO[String]
}
)
)
)

private val schema = Schema(QueryType)
}

0 comments on commit 733e80c

Please sign in to comment.