@@ -1463,7 +1463,7 @@ describe('Objects must adhere to Interface they implement', () => {
1463
1463
} ) . not . to . throw ( ) ;
1464
1464
} ) ;
1465
1465
1466
- it ( 'rejects an Object which implements an Interface field along with more arguments' , ( ) => {
1466
+ it ( 'accepts an Object which implements an Interface field along with additional optional arguments' , ( ) => {
1467
1467
expect ( ( ) => {
1468
1468
var AnotherInterface = new GraphQLInterfaceType ( {
1469
1469
name : 'AnotherInterface' ,
@@ -1492,10 +1492,43 @@ describe('Objects must adhere to Interface they implement', () => {
1492
1492
}
1493
1493
} ) ;
1494
1494
1495
+ return schemaWithFieldType ( AnotherObject ) ;
1496
+ } ) . not . to . throw ( ) ;
1497
+ } ) ;
1498
+
1499
+ it ( 'rejects an Object which implements an Interface field along with additional required arguments' , ( ) => {
1500
+ expect ( ( ) => {
1501
+ var AnotherInterface = new GraphQLInterfaceType ( {
1502
+ name : 'AnotherInterface' ,
1503
+ resolveType : ( ) => null ,
1504
+ fields : {
1505
+ field : {
1506
+ type : GraphQLString ,
1507
+ args : {
1508
+ input : { type : GraphQLString } ,
1509
+ }
1510
+ }
1511
+ }
1512
+ } ) ;
1513
+
1514
+ var AnotherObject = new GraphQLObjectType ( {
1515
+ name : 'AnotherObject' ,
1516
+ interfaces : [ AnotherInterface ] ,
1517
+ fields : {
1518
+ field : {
1519
+ type : GraphQLString ,
1520
+ args : {
1521
+ input : { type : GraphQLString } ,
1522
+ anotherInput : { type : new GraphQLNonNull ( GraphQLString ) } ,
1523
+ }
1524
+ }
1525
+ }
1526
+ } ) ;
1527
+
1495
1528
return schemaWithFieldType ( AnotherObject ) ;
1496
1529
} ) . to . throw (
1497
- 'AnotherInterface .field does not define argument "anotherInput " but ' +
1498
- 'AnotherObject.field provides it .'
1530
+ 'AnotherObject .field(anotherInput:) is of required type "String! " but ' +
1531
+ 'is not also provided by the interface AnotherInterface.field .'
1499
1532
) ;
1500
1533
} ) ;
1501
1534
0 commit comments