Skip to content

Commit

Permalink
Use mapChunksZIO on streams instead of mapZIO (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyri-petrou authored Dec 18, 2023
1 parent 9dd2287 commit cf62c7b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/main/scala/caliban/execution/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,11 @@ object Executor {
case ReducedStep.ListStep(steps, areItemsNullable) => makeListQuery(steps, areItemsNullable)
case ReducedStep.StreamStep(stream) =>
ZQuery
.environment[R]
.map(env =>
.environmentWith[R](env =>
ResponseValue.StreamValue(
stream
.mapZIO(loop(_).catchAll(_ => ZQuery.succeed(NullValue)).run)
.provideEnvironment(env)
stream.mapChunksZIO { chunk =>
collectAll(chunk, isTopLevelField)(loop(_).catchAll(_ => ZQuery.succeed(NullValue))).run
}.provideEnvironment(env)
)
)
case ReducedStep.DeferStep(obj, nextSteps, path) =>
Expand Down

0 comments on commit cf62c7b

Please sign in to comment.