@@ -1198,90 +1198,3 @@ describe('Type System: NonNull must only accept non-nullable types', () => {
1198
1198
} ) ;
1199
1199
}
1200
1200
} ) ;
1201
-
1202
- describe ( 'Type System: A Schema must contain uniquely named types' , ( ) => {
1203
- it ( 'rejects a Schema which redefines a built-in type' , ( ) => {
1204
- expect ( ( ) => {
1205
- const FakeString = new GraphQLScalarType ( {
1206
- name : 'String' ,
1207
- serialize : ( ) => null ,
1208
- } ) ;
1209
-
1210
- const QueryType = new GraphQLObjectType ( {
1211
- name : 'Query' ,
1212
- fields : {
1213
- normal : { type : GraphQLString } ,
1214
- fake : { type : FakeString } ,
1215
- } ,
1216
- } ) ;
1217
-
1218
- return new GraphQLSchema ( { query : QueryType } ) ;
1219
- } ) . to . throw (
1220
- 'Schema must contain unique named types but contains multiple types ' +
1221
- 'named "String".' ,
1222
- ) ;
1223
- } ) ;
1224
-
1225
- it ( 'rejects a Schema which defines an object type twice' , ( ) => {
1226
- expect ( ( ) => {
1227
- const A = new GraphQLObjectType ( {
1228
- name : 'SameName' ,
1229
- fields : { f : { type : GraphQLString } } ,
1230
- } ) ;
1231
-
1232
- const B = new GraphQLObjectType ( {
1233
- name : 'SameName' ,
1234
- fields : { f : { type : GraphQLString } } ,
1235
- } ) ;
1236
-
1237
- const QueryType = new GraphQLObjectType ( {
1238
- name : 'Query' ,
1239
- fields : {
1240
- a : { type : A } ,
1241
- b : { type : B } ,
1242
- } ,
1243
- } ) ;
1244
-
1245
- return new GraphQLSchema ( { query : QueryType } ) ;
1246
- } ) . to . throw (
1247
- 'Schema must contain unique named types but contains multiple types ' +
1248
- 'named "SameName".' ,
1249
- ) ;
1250
- } ) ;
1251
-
1252
- it ( 'rejects a Schema which have same named objects implementing an interface' , ( ) => {
1253
- expect ( ( ) => {
1254
- const AnotherInterface = new GraphQLInterfaceType ( {
1255
- name : 'AnotherInterface' ,
1256
- fields : { f : { type : GraphQLString } } ,
1257
- } ) ;
1258
-
1259
- const FirstBadObject = new GraphQLObjectType ( {
1260
- name : 'BadObject' ,
1261
- interfaces : [ AnotherInterface ] ,
1262
- fields : { f : { type : GraphQLString } } ,
1263
- } ) ;
1264
-
1265
- const SecondBadObject = new GraphQLObjectType ( {
1266
- name : 'BadObject' ,
1267
- interfaces : [ AnotherInterface ] ,
1268
- fields : { f : { type : GraphQLString } } ,
1269
- } ) ;
1270
-
1271
- const QueryType = new GraphQLObjectType ( {
1272
- name : 'Query' ,
1273
- fields : {
1274
- iface : { type : AnotherInterface } ,
1275
- } ,
1276
- } ) ;
1277
-
1278
- return new GraphQLSchema ( {
1279
- query : QueryType ,
1280
- types : [ FirstBadObject , SecondBadObject ] ,
1281
- } ) ;
1282
- } ) . to . throw (
1283
- 'Schema must contain unique named types but contains multiple types ' +
1284
- 'named "BadObject".' ,
1285
- ) ;
1286
- } ) ;
1287
- } ) ;
0 commit comments