@@ -719,7 +719,7 @@ describe('Validate: Overlapping fields can be merged', () => {
719
719
] ) ;
720
720
} ) ;
721
721
722
- describe ( 'nullable field on types which potentially overlap' , ( ) => {
722
+ describe ( 'Nullable field on types which potentially overlap' , ( ) => {
723
723
it ( 'matching required status' , ( ) => {
724
724
expectValidWithSchema (
725
725
schema ,
@@ -955,7 +955,7 @@ describe('Validate: Overlapping fields can be merged', () => {
955
955
} ) ;
956
956
} ) ;
957
957
958
- describe ( 'non -nullable field on types which potentially overlap' , ( ) => {
958
+ describe ( 'Non -nullable field on types which potentially overlap' , ( ) => {
959
959
it ( 'matching required status' , ( ) => {
960
960
expectValidWithSchema (
961
961
schema ,
@@ -1082,7 +1082,61 @@ describe('Validate: Overlapping fields can be merged', () => {
1082
1082
] ) ;
1083
1083
} ) ;
1084
1084
1085
- it ( 'conflicting nullability status with aliases' , ( ) => {
1085
+ it ( 'conflicting requred and optional nullability status with aliases' , ( ) => {
1086
+ expectValidWithSchema (
1087
+ schema ,
1088
+ `
1089
+ {
1090
+ someBox {
1091
+ ...on NonNullStringBox1 {
1092
+ nonNullable: scalar!
1093
+ }
1094
+ ...on NonNullStringBox1Impl {
1095
+ nullable: scalar?
1096
+ }
1097
+ }
1098
+ }
1099
+ ` ,
1100
+ ) ;
1101
+ } ) ;
1102
+
1103
+ it ( 'matching optional and optional nullability status with aliases' , ( ) => {
1104
+ expectValidWithSchema (
1105
+ schema ,
1106
+ `
1107
+ {
1108
+ someBox {
1109
+ ...on NonNullStringBox1 {
1110
+ alsoNullable: scalar?
1111
+ }
1112
+ ...on NonNullStringBox1Impl {
1113
+ nullable: scalar?
1114
+ }
1115
+ }
1116
+ }
1117
+ ` ,
1118
+ ) ;
1119
+ } ) ;
1120
+
1121
+ it ( 'matching required and required nullability status with aliases' , ( ) => {
1122
+ expectValidWithSchema (
1123
+ schema ,
1124
+ `
1125
+ {
1126
+ someBox {
1127
+ ...on NonNullStringBox1 {
1128
+ nonNullable: scalar!
1129
+ }
1130
+ ...on NonNullStringBox1Impl {
1131
+ alsoNonNullable: scalar!
1132
+ }
1133
+ }
1134
+ }
1135
+ ` ,
1136
+ ) ;
1137
+ } ) ;
1138
+
1139
+ it ( 'conflicting required and unset (requred) nullability status with aliases' , ( ) => {
1086
1140
expectValidWithSchema (
1087
1141
schema ,
1088
1142
`
@@ -1099,6 +1153,42 @@ describe('Validate: Overlapping fields can be merged', () => {
1099
1153
` ,
1100
1154
) ;
1101
1155
} ) ;
1156
+
1157
+ it ( 'matching optional and unset (required) nullability status with aliases' , ( ) => {
1158
+ expectValidWithSchema (
1159
+ schema ,
1160
+ `
1161
+ {
1162
+ someBox {
1163
+ ...on NonNullStringBox1 {
1164
+ nullable: scalar?
1165
+ }
1166
+ ...on NonNullStringBox1Impl {
1167
+ nonNullable: scalar
1168
+ }
1169
+ }
1170
+ }
1171
+ ` ,
1172
+ ) ;
1173
+ } ) ;
1174
+
1175
+ it ( 'matching unset (required) and unset (required) nullability status with aliases' , ( ) => {
1176
+ expectValidWithSchema (
1177
+ schema ,
1178
+ `
1179
+ {
1180
+ someBox {
1181
+ ...on NonNullStringBox1 {
1182
+ nonNullable: scalar
1183
+ }
1184
+ ...on NonNullStringBox1Impl {
1185
+ alsoNonNullable: scalar
1186
+ }
1187
+ }
1188
+ }
1189
+ ` ,
1190
+ ) ;
1191
+ } ) ;
1102
1192
} ) ;
1103
1193
1104
1194
describe ( 'Exclusive types without aliases' , ( ) => {
0 commit comments