Skip to content

Commit cae5a5a

Browse files
committed
rebase updates
1 parent ad9ebe4 commit cae5a5a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

juniper_graphql_ws/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,13 @@ impl<S: Schema> Stream for SubscriptionStart<S> {
467467
ref id,
468468
ref mut stream,
469469
} => match Pin::new(stream).poll_next(cx) {
470-
Poll::Ready(Some((data, errors))) => {
470+
Poll::Ready(Some(output)) => {
471471
return Poll::Ready(Some(Reaction::ServerMessage(ServerMessage::Data {
472472
id: id.clone(),
473-
payload: DataPayload { data, errors },
473+
payload: DataPayload {
474+
data: output.data,
475+
errors: output.errors,
476+
},
474477
})));
475478
}
476479
Poll::Ready(None) => {

juniper_subscriptions/src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,25 @@ where
222222
}
223223

224224
if filled_count == obj_len {
225+
let mut errors = vec![];
225226
filled_count = 0;
226227
let new_vec = (0..obj_len).map(|_| None).collect::<Vec<_>>();
227228
let ready_vec = std::mem::replace(&mut ready_vec, new_vec);
228229
let ready_vec_iterator = ready_vec.into_iter().map(|el| {
229230
let (name, val) = el.unwrap();
230-
if let Ok(value) = val {
231-
(name, value)
232-
} else {
233-
(name, Value::Null)
231+
match val {
232+
Ok(value) => (name, value),
233+
Err(e) => {
234+
errors.push(e);
235+
(name, Value::Null)
236+
}
234237
}
235238
});
236239
let obj = Object::from_iter(ready_vec_iterator);
237-
Poll::Ready(Some(ExecutionOutput::from_data(Value::Object(obj))))
240+
Poll::Ready(Some(ExecutionOutput {
241+
data: Value::Object(obj),
242+
errors,
243+
}))
238244
} else {
239245
Poll::Pending
240246
}

0 commit comments

Comments
 (0)