@@ -122,11 +122,19 @@ describe('coerceInputValue', () => {
122122 } ) ;
123123
124124 describe ( 'for GraphQLInputObject' , ( ) => {
125+ const DeepObject = new GraphQLInputObjectType ( {
126+ name : 'DeepObject' ,
127+ fields : {
128+ foo : { type : new GraphQLNonNull ( GraphQLInt ) } ,
129+ bar : { type : GraphQLInt } ,
130+ } ,
131+ } ) ;
125132 const TestInputObject = new GraphQLInputObjectType ( {
126133 name : 'TestInputObject' ,
127134 fields : {
128135 foo : { type : new GraphQLNonNull ( GraphQLInt ) } ,
129136 bar : { type : GraphQLInt } ,
137+ deepObject : { type : DeepObject } ,
130138 } ,
131139 } ) ;
132140
@@ -153,6 +161,14 @@ describe('coerceInputValue', () => {
153161 it ( 'invalid for an unknown field' , ( ) => {
154162 test ( { foo : 123 , unknownField : 123 } , TestInputObject , undefined ) ;
155163 } ) ;
164+
165+ it ( 'invalid for an array type' , ( ) => {
166+ test ( [ { foo : 1 } , { bar : 1 } ] , TestInputObject , undefined ) ;
167+ } ) ;
168+
169+ it ( 'invalid for an array type on a nested field' , ( ) => {
170+ test ( { foo : 1 , deepObject : [ 1 , 2 , 3 ] } , TestInputObject , undefined ) ;
171+ } ) ;
156172 } ) ;
157173
158174 describe ( 'for GraphQLInputObject that isOneOf' , ( ) => {
0 commit comments