@@ -107,28 +107,28 @@ const QueryType = new GraphQLObjectType({
107
107
108
108
test ( 'creates one type per data type' , ( ) => {
109
109
const typeMap = getSchemaFromData (
110
- data
110
+ data ,
111
111
) . getTypeMap ( ) as ObjMap < GraphQLObjectType > ;
112
112
expect ( typeMap . Post . name ) . toEqual ( PostType . name ) ;
113
113
expect ( Object . keys ( typeMap . Post . getFields ( ) ) ) . toEqual (
114
- Object . keys ( PostType . getFields ( ) )
114
+ Object . keys ( PostType . getFields ( ) ) ,
115
115
) ;
116
116
expect ( typeMap . User . name ) . toEqual ( UserType . name ) ;
117
117
expect ( Object . keys ( typeMap . User . getFields ( ) ) ) . toEqual (
118
- Object . keys ( UserType . getFields ( ) )
118
+ Object . keys ( UserType . getFields ( ) ) ,
119
119
) ;
120
120
} ) ;
121
121
122
122
test ( 'creates one field per relationship' , ( ) => {
123
123
const typeMap = getSchemaFromData (
124
- data
124
+ data ,
125
125
) . getTypeMap ( ) as ObjMap < GraphQLObjectType > ;
126
126
expect ( Object . keys ( typeMap . Post . getFields ( ) ) ) . toContain ( 'User' ) ;
127
127
} ) ;
128
128
129
129
test ( 'creates one field per reverse relationship' , ( ) => {
130
130
const typeMap = getSchemaFromData (
131
- data
131
+ data ,
132
132
) . getTypeMap ( ) as ObjMap < GraphQLObjectType > ;
133
133
expect ( Object . keys ( typeMap . User . getFields ( ) ) ) . toContain ( 'Posts' ) ;
134
134
} ) ;
@@ -137,7 +137,7 @@ test('creates three query fields per data type', () => {
137
137
// biome-ignore lint/style/noNonNullAssertion: It's only a test
138
138
const queries = getSchemaFromData ( data ) . getQueryType ( ) ! . getFields ( ) ;
139
139
expect ( ( queries . Post . type as GraphQLObjectType ) . name ) . toEqual (
140
- PostType . name
140
+ PostType . name ,
141
141
) ;
142
142
expect ( queries . Post . args ) . toEqual ( [
143
143
expect . objectContaining ( {
@@ -159,7 +159,7 @@ test('creates three query fields per data type', () => {
159
159
expect ( queries . _allPostsMeta . type . toString ( ) ) . toEqual ( 'ListMetadata' ) ;
160
160
161
161
expect ( ( queries . User . type as GraphQLObjectType ) . name ) . toEqual (
162
- UserType . name
162
+ UserType . name ,
163
163
) ;
164
164
expect ( queries . User . args ) . toEqual ( [
165
165
expect . objectContaining ( {
@@ -185,7 +185,7 @@ test('creates three mutation fields per data type', () => {
185
185
// biome-ignore lint/style/noNonNullAssertion: It's only a test
186
186
const mutations = getSchemaFromData ( data ) . getMutationType ( ) ! . getFields ( ) ;
187
187
expect ( ( mutations . createPost . type as GraphQLObjectType ) . name ) . toEqual (
188
- PostType . name
188
+ PostType . name ,
189
189
) ;
190
190
expect ( mutations . createPost . args ) . toEqual ( [
191
191
expect . objectContaining ( {
@@ -202,7 +202,7 @@ test('creates three mutation fields per data type', () => {
202
202
} ) ,
203
203
] ) ;
204
204
expect ( ( mutations . updatePost . type as GraphQLObjectType ) . name ) . toEqual (
205
- PostType . name
205
+ PostType . name ,
206
206
) ;
207
207
expect ( mutations . updatePost . args ) . toEqual ( [
208
208
expect . objectContaining ( {
@@ -223,7 +223,7 @@ test('creates three mutation fields per data type', () => {
223
223
} ) ,
224
224
] ) ;
225
225
expect ( ( mutations . removePost . type as GraphQLObjectType ) . name ) . toEqual (
226
- PostType . name
226
+ PostType . name ,
227
227
) ;
228
228
expect ( mutations . removePost . args ) . toEqual ( [
229
229
expect . objectContaining ( {
@@ -232,7 +232,7 @@ test('creates three mutation fields per data type', () => {
232
232
} ) ,
233
233
] ) ;
234
234
expect ( ( mutations . createUser . type as GraphQLObjectType ) . name ) . toEqual (
235
- UserType . name
235
+ UserType . name ,
236
236
) ;
237
237
expect ( mutations . createUser . args ) . toEqual ( [
238
238
expect . objectContaining ( {
@@ -241,7 +241,7 @@ test('creates three mutation fields per data type', () => {
241
241
} ) ,
242
242
] ) ;
243
243
expect ( ( mutations . updateUser . type as GraphQLObjectType ) . name ) . toEqual (
244
- UserType . name
244
+ UserType . name ,
245
245
) ;
246
246
expect ( mutations . updateUser . args ) . toEqual ( [
247
247
expect . objectContaining ( {
@@ -254,7 +254,7 @@ test('creates three mutation fields per data type', () => {
254
254
} ) ,
255
255
] ) ;
256
256
expect ( ( mutations . removeUser . type as GraphQLObjectType ) . name ) . toEqual (
257
- UserType . name
257
+ UserType . name ,
258
258
) ;
259
259
expect ( mutations . removeUser . args ) . toEqual ( [
260
260
expect . objectContaining ( {
@@ -269,22 +269,22 @@ test('creates the mutation *Input type for createMany', () => {
269
269
const mutations = getSchemaFromData ( data ) . getMutationType ( ) ! . getFields ( ) ;
270
270
const createManyPostInputType = mutations . createManyPost . args [ 0 ] . type ;
271
271
expect ( createManyPostInputType . toString ( ) ) . toEqual ( '[PostInput]' ) ;
272
- expect ( ( createManyPostInputType as GraphQLList < any > ) . ofType . getFields ( ) ) . toEqual (
273
- {
274
- title : expect . objectContaining ( {
275
- type : new GraphQLNonNull ( GraphQLString ) ,
276
- name : 'title' ,
277
- } ) ,
278
- views : expect . objectContaining ( {
279
- type : new GraphQLNonNull ( GraphQLInt ) ,
280
- name : 'views' ,
281
- } ) ,
282
- user_id : expect . objectContaining ( {
283
- type : new GraphQLNonNull ( GraphQLID ) ,
284
- name : 'user_id' ,
285
- } ) ,
286
- }
287
- ) ;
272
+ expect (
273
+ ( createManyPostInputType as GraphQLList < any > ) . ofType . getFields ( ) ,
274
+ ) . toEqual ( {
275
+ title : expect . objectContaining ( {
276
+ type : new GraphQLNonNull ( GraphQLString ) ,
277
+ name : 'title' ,
278
+ } ) ,
279
+ views : expect . objectContaining ( {
280
+ type : new GraphQLNonNull ( GraphQLInt ) ,
281
+ name : 'views' ,
282
+ } ) ,
283
+ user_id : expect . objectContaining ( {
284
+ type : new GraphQLNonNull ( GraphQLID ) ,
285
+ name : 'user_id' ,
286
+ } ) ,
287
+ } ) ;
288
288
} ) ;
289
289
290
290
test ( 'pluralizes and capitalizes correctly' , ( ) => {
0 commit comments