@@ -369,20 +369,10 @@ describe('Execute: stream directive', () => {
369
369
items : [ { name : 'Luke' , id : '1' } ] ,
370
370
id : '0' ,
371
371
} ,
372
- ] ,
373
- hasNext : true ,
374
- } ,
375
- {
376
- incremental : [
377
372
{
378
373
items : [ { name : 'Han' , id : '2' } ] ,
379
374
id : '0' ,
380
375
} ,
381
- ] ,
382
- hasNext : true ,
383
- } ,
384
- {
385
- incremental : [
386
376
{
387
377
items : [ { name : 'Leia' , id : '3' } ] ,
388
378
id : '0' ,
@@ -527,11 +517,6 @@ describe('Execute: stream directive', () => {
527
517
} ,
528
518
] ,
529
519
} ,
530
- ] ,
531
- hasNext : true ,
532
- } ,
533
- {
534
- incremental : [
535
520
{
536
521
items : [ { name : 'Leia' , id : '3' } ] ,
537
522
id : '0' ,
@@ -591,9 +576,6 @@ describe('Execute: stream directive', () => {
591
576
id : '0' ,
592
577
} ,
593
578
] ,
594
- hasNext : true ,
595
- } ,
596
- {
597
579
completed : [ { id : '0' } ] ,
598
580
hasNext : false ,
599
581
} ,
@@ -633,9 +615,6 @@ describe('Execute: stream directive', () => {
633
615
id : '0' ,
634
616
} ,
635
617
] ,
636
- hasNext : true ,
637
- } ,
638
- {
639
618
completed : [ { id : '0' } ] ,
640
619
hasNext : false ,
641
620
} ,
@@ -676,7 +655,7 @@ describe('Execute: stream directive', () => {
676
655
}
677
656
}
678
657
` ) ;
679
- const result = await completeAsync ( document , 3 , {
658
+ const result = await completeAsync ( document , 2 , {
680
659
async * friendList ( ) {
681
660
yield await Promise . resolve ( friends [ 0 ] ) ;
682
661
yield await Promise . resolve ( friends [ 1 ] ) ;
@@ -706,12 +685,6 @@ describe('Execute: stream directive', () => {
706
685
id : '0' ,
707
686
} ,
708
687
] ,
709
- hasNext : true ,
710
- } ,
711
- } ,
712
- {
713
- done : false ,
714
- value : {
715
688
completed : [ { id : '0' } ] ,
716
689
hasNext : false ,
717
690
} ,
@@ -946,11 +919,6 @@ describe('Execute: stream directive', () => {
946
919
} ,
947
920
] ,
948
921
} ,
949
- ] ,
950
- hasNext : true ,
951
- } ,
952
- {
953
- incremental : [
954
922
{
955
923
items : [ { nonNullName : 'Han' } ] ,
956
924
id : '0' ,
@@ -997,11 +965,6 @@ describe('Execute: stream directive', () => {
997
965
} ,
998
966
] ,
999
967
} ,
1000
- ] ,
1001
- hasNext : true ,
1002
- } ,
1003
- {
1004
- incremental : [
1005
968
{
1006
969
items : [ { nonNullName : 'Han' } ] ,
1007
970
id : '0' ,
@@ -1132,19 +1095,11 @@ describe('Execute: stream directive', () => {
1132
1095
} ,
1133
1096
] ,
1134
1097
} ,
1135
- ] ,
1136
- hasNext : true ,
1137
- } ,
1138
- {
1139
- incremental : [
1140
1098
{
1141
1099
items : [ { nonNullName : 'Han' } ] ,
1142
1100
id : '0' ,
1143
1101
} ,
1144
1102
] ,
1145
- hasNext : true ,
1146
- } ,
1147
- {
1148
1103
completed : [ { id : '0' } ] ,
1149
1104
hasNext : false ,
1150
1105
} ,
@@ -1444,6 +1399,10 @@ describe('Execute: stream directive', () => {
1444
1399
} ,
1445
1400
{
1446
1401
incremental : [
1402
+ {
1403
+ items : [ { name : 'Luke' } ] ,
1404
+ id : '1' ,
1405
+ } ,
1447
1406
{
1448
1407
data : { scalarField : null } ,
1449
1408
id : '0' ,
@@ -1455,16 +1414,8 @@ describe('Execute: stream directive', () => {
1455
1414
} ,
1456
1415
] ,
1457
1416
} ,
1458
- {
1459
- items : [ { name : 'Luke' } ] ,
1460
- id : '1' ,
1461
- } ,
1462
1417
] ,
1463
- completed : [ { id : '0' } ] ,
1464
- hasNext : true ,
1465
- } ,
1466
- {
1467
- completed : [ { id : '1' } ] ,
1418
+ completed : [ { id : '0' } , { id : '1' } ] ,
1468
1419
hasNext : false ,
1469
1420
} ,
1470
1421
] ) ;
@@ -1570,9 +1521,6 @@ describe('Execute: stream directive', () => {
1570
1521
] ,
1571
1522
} ,
1572
1523
] ,
1573
- hasNext : true ,
1574
- } ,
1575
- {
1576
1524
completed : [ { id : '0' } ] ,
1577
1525
hasNext : false ,
1578
1526
} ,
@@ -1724,9 +1672,6 @@ describe('Execute: stream directive', () => {
1724
1672
id : '0' ,
1725
1673
} ,
1726
1674
] ,
1727
- hasNext : true ,
1728
- } ,
1729
- {
1730
1675
completed : [ { id : '0' } ] ,
1731
1676
hasNext : false ,
1732
1677
} ,
@@ -1774,19 +1719,11 @@ describe('Execute: stream directive', () => {
1774
1719
items : [ { id : '1' , name : 'Luke' } ] ,
1775
1720
id : '0' ,
1776
1721
} ,
1777
- ] ,
1778
- hasNext : true ,
1779
- } ,
1780
- {
1781
- incremental : [
1782
1722
{
1783
1723
items : [ { id : '2' , name : 'Han' } ] ,
1784
1724
id : '0' ,
1785
1725
} ,
1786
1726
] ,
1787
- hasNext : true ,
1788
- } ,
1789
- {
1790
1727
completed : [ { id : '0' } ] ,
1791
1728
hasNext : false ,
1792
1729
} ,
@@ -1844,48 +1781,22 @@ describe('Execute: stream directive', () => {
1844
1781
data : { scalarField : 'slow' , nestedFriendList : [ ] } ,
1845
1782
id : '0' ,
1846
1783
} ,
1847
- ] ,
1848
- completed : [ { id : '0' } ] ,
1849
- hasNext : true ,
1850
- } ,
1851
- done : false ,
1852
- } ) ;
1853
- const result3 = await iterator . next ( ) ;
1854
- expectJSON ( result3 ) . toDeepEqual ( {
1855
- value : {
1856
- incremental : [
1857
1784
{
1858
1785
items : [ { name : 'Luke' } ] ,
1859
1786
id : '1' ,
1860
1787
} ,
1861
- ] ,
1862
- hasNext : true ,
1863
- } ,
1864
- done : false ,
1865
- } ) ;
1866
- const result4 = await iterator . next ( ) ;
1867
- expectJSON ( result4 ) . toDeepEqual ( {
1868
- value : {
1869
- incremental : [
1870
1788
{
1871
1789
items : [ { name : 'Han' } ] ,
1872
1790
id : '1' ,
1873
1791
} ,
1874
1792
] ,
1875
- hasNext : true ,
1876
- } ,
1877
- done : false ,
1878
- } ) ;
1879
- const result5 = await iterator . next ( ) ;
1880
- expectJSON ( result5 ) . toDeepEqual ( {
1881
- value : {
1882
- completed : [ { id : '1' } ] ,
1793
+ completed : [ { id : '0' } , { id : '1' } ] ,
1883
1794
hasNext : false ,
1884
1795
} ,
1885
1796
done : false ,
1886
1797
} ) ;
1887
- const result6 = await iterator . next ( ) ;
1888
- expectJSON ( result6 ) . toDeepEqual ( {
1798
+ const result3 = await iterator . next ( ) ;
1799
+ expectJSON ( result3 ) . toDeepEqual ( {
1889
1800
value : undefined ,
1890
1801
done : true ,
1891
1802
} ) ;
@@ -1944,14 +1855,14 @@ describe('Execute: stream directive', () => {
1944
1855
value : {
1945
1856
pending : [ { id : '2' , path : [ 'friendList' , 1 ] , label : 'DeferName' } ] ,
1946
1857
incremental : [
1947
- {
1948
- data : { name : 'Luke' } ,
1949
- id : '0' ,
1950
- } ,
1951
1858
{
1952
1859
items : [ { id : '2' } ] ,
1953
1860
id : '1' ,
1954
1861
} ,
1862
+ {
1863
+ data : { name : 'Luke' } ,
1864
+ id : '0' ,
1865
+ } ,
1955
1866
] ,
1956
1867
completed : [ { id : '0' } ] ,
1957
1868
hasNext : true ,
@@ -2047,14 +1958,14 @@ describe('Execute: stream directive', () => {
2047
1958
value : {
2048
1959
pending : [ { id : '2' , path : [ 'friendList' , 1 ] , label : 'DeferName' } ] ,
2049
1960
incremental : [
2050
- {
2051
- data : { name : 'Luke' } ,
2052
- id : '0' ,
2053
- } ,
2054
1961
{
2055
1962
items : [ { id : '2' } ] ,
2056
1963
id : '1' ,
2057
1964
} ,
1965
+ {
1966
+ data : { name : 'Luke' } ,
1967
+ id : '0' ,
1968
+ } ,
2058
1969
] ,
2059
1970
completed : [ { id : '0' } ] ,
2060
1971
hasNext : true ,
0 commit comments