@@ -18,7 +18,6 @@ import {
18
18
GraphQLObjectType ,
19
19
GraphQLString ,
20
20
GraphQLInt ,
21
- GraphQLList ,
22
21
GraphQLNonNull
23
22
} from '../../type' ;
24
23
@@ -69,7 +68,7 @@ function check(testType, testData, expected) {
69
68
describe ( 'Execute: Accepts any iterable as list value' , ( ) => {
70
69
71
70
it ( 'Accepts a Set as a List value' , check (
72
- new GraphQLList ( GraphQLString ) ,
71
+ GraphQLString . wrapList ( ) ,
73
72
new Set ( [ 'apple' , 'banana' , 'apple' , 'coconut' ] ) ,
74
73
{ data : { nest : { test : [ 'apple' , 'banana' , 'coconut' ] } } }
75
74
) ) ;
@@ -81,7 +80,7 @@ describe('Execute: Accepts any iterable as list value', () => {
81
80
}
82
81
83
82
it ( 'Accepts an Generator function as a List value' , check (
84
- new GraphQLList ( GraphQLString ) ,
83
+ GraphQLString . wrapList ( ) ,
85
84
yieldItems ( ) ,
86
85
{ data : { nest : { test : [ 'one' , '2' , 'true' ] } } }
87
86
) ) ;
@@ -91,13 +90,13 @@ describe('Execute: Accepts any iterable as list value', () => {
91
90
}
92
91
93
92
it ( 'Accepts function arguments as a List value' , check (
94
- new GraphQLList ( GraphQLString ) ,
93
+ GraphQLString . wrapList ( ) ,
95
94
getArgs ( 'one' , 'two' ) ,
96
95
{ data : { nest : { test : [ 'one' , 'two' ] } } }
97
96
) ) ;
98
97
99
98
it ( 'Does not accept (Iterable) String-literal as a List value' , check (
100
- new GraphQLList ( GraphQLString ) ,
99
+ GraphQLString . wrapList ( ) ,
101
100
'Singluar' ,
102
101
{ data : { nest : { test : null } } ,
103
102
errors : [ {
@@ -112,7 +111,7 @@ describe('Execute: Accepts any iterable as list value', () => {
112
111
describe ( 'Execute: Handles list nullability' , ( ) => {
113
112
114
113
describe ( '[T]' , ( ) => {
115
- const type = new GraphQLList ( GraphQLInt ) ;
114
+ const type = GraphQLInt . wrapList ( ) ;
116
115
117
116
describe ( 'Array<T>' , ( ) => {
118
117
@@ -190,7 +189,7 @@ describe('Execute: Handles list nullability', () => {
190
189
} ) ;
191
190
192
191
describe ( '[T]!' , ( ) => {
193
- const type = new GraphQLNonNull ( new GraphQLList ( GraphQLInt ) ) ;
192
+ const type = new GraphQLNonNull ( GraphQLInt . wrapList ( ) ) ;
194
193
195
194
describe ( 'Array<T>' , ( ) => {
196
195
@@ -277,7 +276,7 @@ describe('Execute: Handles list nullability', () => {
277
276
} ) ;
278
277
279
278
describe ( '[T!]' , ( ) => {
280
- const type = new GraphQLList ( new GraphQLNonNull ( GraphQLInt ) ) ;
279
+ const type = ( new GraphQLNonNull ( GraphQLInt ) ) . wrapList ( ) ;
281
280
282
281
describe ( 'Array<T>' , ( ) => {
283
282
@@ -370,7 +369,7 @@ describe('Execute: Handles list nullability', () => {
370
369
371
370
describe ( '[T!]!' , ( ) => {
372
371
const type =
373
- new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( GraphQLInt ) ) ) ;
372
+ new GraphQLNonNull ( ( new GraphQLNonNull ( GraphQLInt ) ) . wrapList ( ) ) ;
374
373
375
374
describe ( 'Array<T>' , ( ) => {
376
375
0 commit comments