@@ -137,38 +137,16 @@ test('creates three query fields per data type', () => {
137137 } ,
138138 ] ) ;
139139 expect ( queries [ 'allPosts' ] . type . toString ( ) ) . toEqual ( '[Post]' ) ;
140- expect ( queries [ 'allPosts' ] . args ) . toEqual ( [
141- {
142- defaultValue : undefined ,
143- description : null ,
144- name : 'page' ,
145- type : GraphQLInt ,
146- } ,
147- {
148- defaultValue : undefined ,
149- description : null ,
150- name : 'perPage' ,
151- type : GraphQLInt ,
152- } ,
153- {
154- defaultValue : undefined ,
155- description : null ,
156- name : 'sortField' ,
157- type : GraphQLString ,
158- } ,
159- {
160- defaultValue : undefined ,
161- description : null ,
162- name : 'sortOrder' ,
163- type : GraphQLString ,
164- } ,
165- {
166- defaultValue : undefined ,
167- description : null ,
168- name : 'filter' ,
169- type : GraphQLString ,
170- } ,
171- ] ) ;
140+ expect ( queries [ 'allPosts' ] . args [ 0 ] . name ) . toEqual ( 'page' ) ;
141+ expect ( queries [ 'allPosts' ] . args [ 0 ] . type ) . toEqual ( GraphQLInt ) ;
142+ expect ( queries [ 'allPosts' ] . args [ 1 ] . name ) . toEqual ( 'perPage' ) ;
143+ expect ( queries [ 'allPosts' ] . args [ 1 ] . type ) . toEqual ( GraphQLInt ) ;
144+ expect ( queries [ 'allPosts' ] . args [ 2 ] . name ) . toEqual ( 'sortField' ) ;
145+ expect ( queries [ 'allPosts' ] . args [ 2 ] . type ) . toEqual ( GraphQLString ) ;
146+ expect ( queries [ 'allPosts' ] . args [ 3 ] . name ) . toEqual ( 'sortOrder' ) ;
147+ expect ( queries [ 'allPosts' ] . args [ 3 ] . type ) . toEqual ( GraphQLString ) ;
148+ expect ( queries [ 'allPosts' ] . args [ 4 ] . name ) . toEqual ( 'filter' ) ;
149+ expect ( queries [ 'allPosts' ] . args [ 4 ] . type . toString ( ) ) . toEqual ( 'PostFilter' ) ;
172150 expect ( queries [ '_allPostsMeta' ] . type . toString ( ) ) . toEqual ( 'ListMetadata' ) ;
173151
174152 expect ( queries [ 'User' ] . type . name ) . toEqual ( UserType . name ) ;
@@ -181,38 +159,16 @@ test('creates three query fields per data type', () => {
181159 } ,
182160 ] ) ;
183161 expect ( queries [ 'allUsers' ] . type . toString ( ) ) . toEqual ( '[User]' ) ;
184- expect ( queries [ 'allUsers' ] . args ) . toEqual ( [
185- {
186- defaultValue : undefined ,
187- description : null ,
188- name : 'page' ,
189- type : GraphQLInt ,
190- } ,
191- {
192- defaultValue : undefined ,
193- description : null ,
194- name : 'perPage' ,
195- type : GraphQLInt ,
196- } ,
197- {
198- defaultValue : undefined ,
199- description : null ,
200- name : 'sortField' ,
201- type : GraphQLString ,
202- } ,
203- {
204- defaultValue : undefined ,
205- description : null ,
206- name : 'sortOrder' ,
207- type : GraphQLString ,
208- } ,
209- {
210- defaultValue : undefined ,
211- description : null ,
212- name : 'filter' ,
213- type : GraphQLString ,
214- } ,
215- ] ) ;
162+ expect ( queries [ 'allUsers' ] . args [ 0 ] . name ) . toEqual ( 'page' ) ;
163+ expect ( queries [ 'allUsers' ] . args [ 0 ] . type ) . toEqual ( GraphQLInt ) ;
164+ expect ( queries [ 'allUsers' ] . args [ 1 ] . name ) . toEqual ( 'perPage' ) ;
165+ expect ( queries [ 'allUsers' ] . args [ 1 ] . type ) . toEqual ( GraphQLInt ) ;
166+ expect ( queries [ 'allUsers' ] . args [ 2 ] . name ) . toEqual ( 'sortField' ) ;
167+ expect ( queries [ 'allUsers' ] . args [ 2 ] . type ) . toEqual ( GraphQLString ) ;
168+ expect ( queries [ 'allUsers' ] . args [ 3 ] . name ) . toEqual ( 'sortOrder' ) ;
169+ expect ( queries [ 'allUsers' ] . args [ 3 ] . type ) . toEqual ( GraphQLString ) ;
170+ expect ( queries [ 'allUsers' ] . args [ 4 ] . name ) . toEqual ( 'filter' ) ;
171+ expect ( queries [ 'allUsers' ] . args [ 4 ] . type . toString ( ) ) . toEqual ( 'UserFilter' ) ;
216172 expect ( queries [ '_allPostsMeta' ] . type . toString ( ) ) . toEqual ( 'ListMetadata' ) ;
217173} ) ;
218174
0 commit comments