@@ -99,6 +99,7 @@ const a = new GraphQLObjectType({
99
99
fields : {
100
100
b : { type : b } ,
101
101
someField : { type : GraphQLString } ,
102
+ nonNullErrorField : { type : new GraphQLNonNull ( GraphQLString ) } ,
102
103
} ,
103
104
name : 'a' ,
104
105
} ) ;
@@ -1688,6 +1689,83 @@ describe('Execute: defer directive', () => {
1688
1689
] ) ;
1689
1690
} ) ;
1690
1691
1692
+ it ( 'Nulls cross defer boundaries, failed fragment with slower shared child execution groups' , async ( ) => {
1693
+ const document = parse ( `
1694
+ query {
1695
+ ... @defer {
1696
+ a {
1697
+ someField
1698
+ nonNullErrorField
1699
+ b {
1700
+ c {
1701
+ d
1702
+ }
1703
+ }
1704
+ }
1705
+ }
1706
+ a {
1707
+ ... @defer {
1708
+ someField
1709
+ b {
1710
+ e {
1711
+ f
1712
+ }
1713
+ }
1714
+ }
1715
+ }
1716
+ }
1717
+ ` ) ;
1718
+ const result = await complete ( document , {
1719
+ a : {
1720
+ b : { c : { d : 'd' } , e : { f : 'f' } } ,
1721
+ someField : Promise . resolve ( 'someField' ) ,
1722
+ } ,
1723
+ } ) ;
1724
+ expectJSON ( result ) . toDeepEqual ( [
1725
+ {
1726
+ data : {
1727
+ a : { } ,
1728
+ } ,
1729
+ pending : [
1730
+ { id : '0' , path : [ ] } ,
1731
+ { id : '1' , path : [ 'a' ] } ,
1732
+ ] ,
1733
+ hasNext : true ,
1734
+ } ,
1735
+ {
1736
+ completed : [
1737
+ {
1738
+ id : '0' ,
1739
+ errors : [
1740
+ {
1741
+ message :
1742
+ 'Cannot return null for non-nullable field a.nonNullErrorField.' ,
1743
+ locations : [ { line : 6 , column : 13 } ] ,
1744
+ path : [ 'a' , 'nonNullErrorField' ] ,
1745
+ } ,
1746
+ ] ,
1747
+ } ,
1748
+ ] ,
1749
+ hasNext : true ,
1750
+ } ,
1751
+ {
1752
+ incremental : [
1753
+ {
1754
+ data : { b : { } , someField : 'someField' } ,
1755
+ id : '1' ,
1756
+ } ,
1757
+ {
1758
+ data : { e : { f : 'f' } } ,
1759
+ id : '1' ,
1760
+ subPath : [ 'b' ] ,
1761
+ } ,
1762
+ ] ,
1763
+ completed : [ { id : '1' } ] ,
1764
+ hasNext : false ,
1765
+ } ,
1766
+ ] ) ;
1767
+ } ) ;
1768
+
1691
1769
it ( 'Handles multiple erroring deferred grouped field sets' , async ( ) => {
1692
1770
const document = parse ( `
1693
1771
query {
0 commit comments