File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
juniper_subscriptions/src Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -467,10 +467,13 @@ impl<S: Schema> Stream for SubscriptionStart<S> {
467
467
ref id,
468
468
ref mut stream,
469
469
} => match Pin :: new ( stream) . poll_next ( cx) {
470
- Poll :: Ready ( Some ( ( data , errors ) ) ) => {
470
+ Poll :: Ready ( Some ( output ) ) => {
471
471
return Poll :: Ready ( Some ( Reaction :: ServerMessage ( ServerMessage :: Data {
472
472
id : id. clone ( ) ,
473
- payload : DataPayload { data, errors } ,
473
+ payload : DataPayload {
474
+ data : output. data ,
475
+ errors : output. errors ,
476
+ } ,
474
477
} ) ) ) ;
475
478
}
476
479
Poll :: Ready ( None ) => {
Original file line number Diff line number Diff line change @@ -222,19 +222,25 @@ where
222
222
}
223
223
224
224
if filled_count == obj_len {
225
+ let mut errors = vec ! [ ] ;
225
226
filled_count = 0 ;
226
227
let new_vec = ( 0 ..obj_len) . map ( |_| None ) . collect :: < Vec < _ > > ( ) ;
227
228
let ready_vec = std:: mem:: replace ( & mut ready_vec, new_vec) ;
228
229
let ready_vec_iterator = ready_vec. into_iter ( ) . map ( |el| {
229
230
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
+ }
234
237
}
235
238
} ) ;
236
239
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
+ } ) )
238
244
} else {
239
245
Poll :: Pending
240
246
}
You can’t perform that action at this time.
0 commit comments