@@ -151,11 +151,10 @@ describe('Execute: stream directive', () => {
151
151
hasNext : true ,
152
152
} ,
153
153
{
154
- incremental : [ { items : [ 'banana' ] , path : [ 'scalarList' , 1 ] } ] ,
155
- hasNext : true ,
156
- } ,
157
- {
158
- incremental : [ { items : [ 'coconut' ] , path : [ 'scalarList' , 2 ] } ] ,
154
+ incremental : [
155
+ { items : [ 'banana' ] , path : [ 'scalarList' , 1 ] } ,
156
+ { items : [ 'coconut' ] , path : [ 'scalarList' , 2 ] } ,
157
+ ] ,
159
158
hasNext : false ,
160
159
} ,
161
160
] ) ;
@@ -173,15 +172,11 @@ describe('Execute: stream directive', () => {
173
172
hasNext : true ,
174
173
} ,
175
174
{
176
- incremental : [ { items : [ 'apple' ] , path : [ 'scalarList' , 0 ] } ] ,
177
- hasNext : true ,
178
- } ,
179
- {
180
- incremental : [ { items : [ 'banana' ] , path : [ 'scalarList' , 1 ] } ] ,
181
- hasNext : true ,
182
- } ,
183
- {
184
- incremental : [ { items : [ 'coconut' ] , path : [ 'scalarList' , 2 ] } ] ,
175
+ incremental : [
176
+ { items : [ 'apple' ] , path : [ 'scalarList' , 0 ] } ,
177
+ { items : [ 'banana' ] , path : [ 'scalarList' , 1 ] } ,
178
+ { items : [ 'coconut' ] , path : [ 'scalarList' , 2 ] } ,
179
+ ] ,
185
180
hasNext : false ,
186
181
} ,
187
182
] ) ;
@@ -230,11 +225,6 @@ describe('Execute: stream directive', () => {
230
225
path : [ 'scalarList' , 1 ] ,
231
226
label : 'scalar-stream' ,
232
227
} ,
233
- ] ,
234
- hasNext : true ,
235
- } ,
236
- {
237
- incremental : [
238
228
{
239
229
items : [ 'coconut' ] ,
240
230
path : [ 'scalarList' , 2 ] ,
@@ -296,11 +286,6 @@ describe('Execute: stream directive', () => {
296
286
items : [ [ 'banana' , 'banana' , 'banana' ] ] ,
297
287
path : [ 'scalarListList' , 1 ] ,
298
288
} ,
299
- ] ,
300
- hasNext : true ,
301
- } ,
302
- {
303
- incremental : [
304
289
{
305
290
items : [ [ 'coconut' , 'coconut' , 'coconut' ] ] ,
306
291
path : [ 'scalarListList' , 2 ] ,
@@ -379,20 +364,10 @@ describe('Execute: stream directive', () => {
379
364
items : [ { name : 'Luke' , id : '1' } ] ,
380
365
path : [ 'friendList' , 0 ] ,
381
366
} ,
382
- ] ,
383
- hasNext : true ,
384
- } ,
385
- {
386
- incremental : [
387
367
{
388
368
items : [ { name : 'Han' , id : '2' } ] ,
389
369
path : [ 'friendList' , 1 ] ,
390
370
} ,
391
- ] ,
392
- hasNext : true ,
393
- } ,
394
- {
395
- incremental : [
396
371
{
397
372
items : [ { name : 'Leia' , id : '3' } ] ,
398
373
path : [ 'friendList' , 2 ] ,
@@ -483,11 +458,6 @@ describe('Execute: stream directive', () => {
483
458
} ,
484
459
] ,
485
460
} ,
486
- ] ,
487
- hasNext : true ,
488
- } ,
489
- {
490
- incremental : [
491
461
{
492
462
items : [ { name : 'Leia' , id : '3' } ] ,
493
463
path : [ 'friendList' , 2 ] ,
@@ -585,9 +555,6 @@ describe('Execute: stream directive', () => {
585
555
path : [ 'friendList' , 2 ] ,
586
556
} ,
587
557
] ,
588
- hasNext : true ,
589
- } ,
590
- {
591
558
hasNext : false ,
592
559
} ,
593
560
] ) ;
@@ -627,7 +594,7 @@ describe('Execute: stream directive', () => {
627
594
}
628
595
}
629
596
` ) ;
630
- const result = await completeAsync ( document , 3 , {
597
+ const result = await completeAsync ( document , 2 , {
631
598
async * friendList ( ) {
632
599
yield await Promise . resolve ( friends [ 0 ] ) ;
633
600
yield await Promise . resolve ( friends [ 1 ] ) ;
@@ -656,10 +623,9 @@ describe('Execute: stream directive', () => {
656
623
path : [ 'friendList' , 2 ] ,
657
624
} ,
658
625
] ,
659
- hasNext : true ,
626
+ hasNext : false ,
660
627
} ,
661
628
} ,
662
- { done : false , value : { hasNext : false } } ,
663
629
{ done : true , value : undefined } ,
664
630
] ) ;
665
631
} ) ;
@@ -887,11 +853,6 @@ describe('Execute: stream directive', () => {
887
853
} ,
888
854
] ,
889
855
} ,
890
- ] ,
891
- hasNext : true ,
892
- } ,
893
- {
894
- incremental : [
895
856
{
896
857
items : [ { nonNullName : 'Han' } ] ,
897
858
path : [ 'friendList' , 2 ] ,
@@ -980,11 +941,6 @@ describe('Execute: stream directive', () => {
980
941
} ,
981
942
] ,
982
943
} ,
983
- ] ,
984
- hasNext : true ,
985
- } ,
986
- {
987
- incremental : [
988
944
{
989
945
items : [ { nonNullName : 'Han' } ] ,
990
946
path : [ 'friendList' , 2 ] ,
@@ -1140,6 +1096,10 @@ describe('Execute: stream directive', () => {
1140
1096
} ,
1141
1097
{
1142
1098
incremental : [
1099
+ {
1100
+ items : [ { name : 'Luke' } ] ,
1101
+ path : [ 'nestedObject' , 'nestedFriendList' , 0 ] ,
1102
+ } ,
1143
1103
{
1144
1104
data : { scalarField : null } ,
1145
1105
path : [ 'otherNestedObject' ] ,
@@ -1151,10 +1111,6 @@ describe('Execute: stream directive', () => {
1151
1111
} ,
1152
1112
] ,
1153
1113
} ,
1154
- {
1155
- items : [ { name : 'Luke' } ] ,
1156
- path : [ 'nestedObject' , 'nestedFriendList' , 0 ] ,
1157
- } ,
1158
1114
] ,
1159
1115
hasNext : false ,
1160
1116
} ,
@@ -1258,9 +1214,6 @@ describe('Execute: stream directive', () => {
1258
1214
] ,
1259
1215
} ,
1260
1216
] ,
1261
- hasNext : true ,
1262
- } ,
1263
- {
1264
1217
hasNext : false ,
1265
1218
} ,
1266
1219
] ) ;
@@ -1407,9 +1360,6 @@ describe('Execute: stream directive', () => {
1407
1360
path : [ 'friendList' , 2 ] ,
1408
1361
} ,
1409
1362
] ,
1410
- hasNext : true ,
1411
- } ,
1412
- {
1413
1363
hasNext : false ,
1414
1364
} ,
1415
1365
] ) ;
@@ -1463,15 +1413,6 @@ describe('Execute: stream directive', () => {
1463
1413
data : { scalarField : 'slow' , nestedFriendList : [ ] } ,
1464
1414
path : [ 'nestedObject' ] ,
1465
1415
} ,
1466
- ] ,
1467
- hasNext : true ,
1468
- } ,
1469
- done : false ,
1470
- } ) ;
1471
- const result3 = await iterator . next ( ) ;
1472
- expectJSON ( result3 ) . toDeepEqual ( {
1473
- value : {
1474
- incremental : [
1475
1416
{
1476
1417
items : [ { name : 'Luke' } ] ,
1477
1418
path : [ 'nestedObject' , 'nestedFriendList' , 0 ] ,
@@ -1481,8 +1422,8 @@ describe('Execute: stream directive', () => {
1481
1422
} ,
1482
1423
done : false ,
1483
1424
} ) ;
1484
- const result4 = await iterator . next ( ) ;
1485
- expectJSON ( result4 ) . toDeepEqual ( {
1425
+ const result3 = await iterator . next ( ) ;
1426
+ expectJSON ( result3 ) . toDeepEqual ( {
1486
1427
value : {
1487
1428
incremental : [
1488
1429
{
@@ -1494,13 +1435,13 @@ describe('Execute: stream directive', () => {
1494
1435
} ,
1495
1436
done : false ,
1496
1437
} ) ;
1497
- const result5 = await iterator . next ( ) ;
1498
- expectJSON ( result5 ) . toDeepEqual ( {
1438
+ const result4 = await iterator . next ( ) ;
1439
+ expectJSON ( result4 ) . toDeepEqual ( {
1499
1440
value : { hasNext : false } ,
1500
1441
done : false ,
1501
1442
} ) ;
1502
- const result6 = await iterator . next ( ) ;
1503
- expectJSON ( result6 ) . toDeepEqual ( {
1443
+ const result5 = await iterator . next ( ) ;
1444
+ expectJSON ( result5 ) . toDeepEqual ( {
1504
1445
value : undefined ,
1505
1446
done : true ,
1506
1447
} ) ;
0 commit comments