@@ -594,9 +594,6 @@ describe('Execute: stream directive', () => {
594
594
path : [ 'friendList' , 2 ] ,
595
595
} ,
596
596
] ,
597
- hasNext : true ,
598
- } ,
599
- {
600
597
hasNext : false ,
601
598
} ,
602
599
] ) ;
@@ -634,9 +631,6 @@ describe('Execute: stream directive', () => {
634
631
path : [ 'friendList' , 2 ] ,
635
632
} ,
636
633
] ,
637
- hasNext : true ,
638
- } ,
639
- {
640
634
hasNext : false ,
641
635
} ,
642
636
] ) ;
@@ -676,7 +670,7 @@ describe('Execute: stream directive', () => {
676
670
}
677
671
}
678
672
` ) ;
679
- const result = await completeAsync ( document , 3 , {
673
+ const result = await completeAsync ( document , 2 , {
680
674
async * friendList ( ) {
681
675
yield await Promise . resolve ( friends [ 0 ] ) ;
682
676
yield await Promise . resolve ( friends [ 1 ] ) ;
@@ -705,10 +699,9 @@ describe('Execute: stream directive', () => {
705
699
path : [ 'friendList' , 2 ] ,
706
700
} ,
707
701
] ,
708
- hasNext : true ,
702
+ hasNext : false ,
709
703
} ,
710
704
} ,
711
- { done : false , value : { hasNext : false } } ,
712
705
{ done : true , value : undefined } ,
713
706
] ) ;
714
707
} ) ;
@@ -1128,9 +1121,6 @@ describe('Execute: stream directive', () => {
1128
1121
path : [ 'friendList' , 2 ] ,
1129
1122
} ,
1130
1123
] ,
1131
- hasNext : true ,
1132
- } ,
1133
- {
1134
1124
hasNext : false ,
1135
1125
} ,
1136
1126
] ) ;
@@ -1175,9 +1165,6 @@ describe('Execute: stream directive', () => {
1175
1165
] ,
1176
1166
} ,
1177
1167
] ,
1178
- hasNext : true ,
1179
- } ,
1180
- {
1181
1168
hasNext : false ,
1182
1169
} ,
1183
1170
] ) ;
@@ -1246,9 +1233,6 @@ describe('Execute: stream directive', () => {
1246
1233
] ,
1247
1234
} ,
1248
1235
] ,
1249
- hasNext : true ,
1250
- } ,
1251
- {
1252
1236
hasNext : false ,
1253
1237
} ,
1254
1238
] ) ;
@@ -1327,9 +1311,6 @@ describe('Execute: stream directive', () => {
1327
1311
] ,
1328
1312
} ,
1329
1313
] ,
1330
- hasNext : true ,
1331
- } ,
1332
- {
1333
1314
hasNext : false ,
1334
1315
} ,
1335
1316
] ) ;
@@ -1353,25 +1334,19 @@ describe('Execute: stream directive', () => {
1353
1334
} /* c8 ignore stop */ ,
1354
1335
} ,
1355
1336
} ) ;
1356
- expectJSON ( result ) . toDeepEqual ( [
1357
- {
1358
- errors : [
1359
- {
1360
- message :
1361
- 'Cannot return null for non-nullable field NestedObject.nonNullScalarField.' ,
1362
- locations : [ { line : 4 , column : 11 } ] ,
1363
- path : [ 'nestedObject' , 'nonNullScalarField' ] ,
1364
- } ,
1365
- ] ,
1366
- data : {
1367
- nestedObject : null ,
1337
+ expectJSON ( result ) . toDeepEqual ( {
1338
+ errors : [
1339
+ {
1340
+ message :
1341
+ 'Cannot return null for non-nullable field NestedObject.nonNullScalarField.' ,
1342
+ locations : [ { line : 4 , column : 11 } ] ,
1343
+ path : [ 'nestedObject' , 'nonNullScalarField' ] ,
1368
1344
} ,
1369
- hasNext : true ,
1370
- } ,
1371
- {
1372
- hasNext : false ,
1345
+ ] ,
1346
+ data : {
1347
+ nestedObject : null ,
1373
1348
} ,
1374
- ] ) ;
1349
+ } ) ;
1375
1350
} ) ;
1376
1351
it ( 'Filters payloads that are nulled by a later synchronous error' , async ( ) => {
1377
1352
const document = parse ( `
@@ -1557,9 +1532,6 @@ describe('Execute: stream directive', () => {
1557
1532
] ,
1558
1533
} ,
1559
1534
] ,
1560
- hasNext : true ,
1561
- } ,
1562
- {
1563
1535
hasNext : false ,
1564
1536
} ,
1565
1537
] ) ;
@@ -1707,9 +1679,6 @@ describe('Execute: stream directive', () => {
1707
1679
path : [ 'friendList' , 2 ] ,
1708
1680
} ,
1709
1681
] ,
1710
- hasNext : true ,
1711
- } ,
1712
- {
1713
1682
hasNext : false ,
1714
1683
} ,
1715
1684
] ) ;
@@ -1771,9 +1740,6 @@ describe('Execute: stream directive', () => {
1771
1740
path : [ 'nestedObject' , 'nestedFriendList' , 1 ] ,
1772
1741
} ,
1773
1742
] ,
1774
- hasNext : true ,
1775
- } ,
1776
- {
1777
1743
hasNext : false ,
1778
1744
} ,
1779
1745
] ) ;
@@ -1854,17 +1820,12 @@ describe('Execute: stream directive', () => {
1854
1820
path : [ 'nestedObject' , 'nestedFriendList' , 1 ] ,
1855
1821
} ,
1856
1822
] ,
1857
- hasNext : true ,
1823
+ hasNext : false ,
1858
1824
} ,
1859
1825
done : false ,
1860
1826
} ) ;
1861
1827
const result5 = await iterator . next ( ) ;
1862
1828
expectJSON ( result5 ) . toDeepEqual ( {
1863
- value : { hasNext : false } ,
1864
- done : false ,
1865
- } ) ;
1866
- const result6 = await iterator . next ( ) ;
1867
- expectJSON ( result6 ) . toDeepEqual ( {
1868
1829
value : undefined ,
1869
1830
done : true ,
1870
1831
} ) ;
0 commit comments