@@ -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,16 +223,25 @@ 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 ( {
230
230
name : 'id' ,
231
231
type : new GraphQLNonNull ( GraphQLID ) ,
232
232
} ) ,
233
233
] ) ;
234
+ expect ( ( mutations . deletePost . type as GraphQLObjectType ) . name ) . toEqual (
235
+ PostType . name
236
+ ) ;
237
+ expect ( mutations . deletePost . args ) . toEqual ( [
238
+ expect . objectContaining ( {
239
+ name : 'id' ,
240
+ type : new GraphQLNonNull ( GraphQLID ) ,
241
+ } ) ,
242
+ ] ) ;
234
243
expect ( ( mutations . createUser . type as GraphQLObjectType ) . name ) . toEqual (
235
- UserType . name ,
244
+ UserType . name
236
245
) ;
237
246
expect ( mutations . createUser . args ) . toEqual ( [
238
247
expect . objectContaining ( {
@@ -241,7 +250,7 @@ test('creates three mutation fields per data type', () => {
241
250
} ) ,
242
251
] ) ;
243
252
expect ( ( mutations . updateUser . type as GraphQLObjectType ) . name ) . toEqual (
244
- UserType . name ,
253
+ UserType . name
245
254
) ;
246
255
expect ( mutations . updateUser . args ) . toEqual ( [
247
256
expect . objectContaining ( {
@@ -254,14 +263,23 @@ test('creates three mutation fields per data type', () => {
254
263
} ) ,
255
264
] ) ;
256
265
expect ( ( mutations . removeUser . type as GraphQLObjectType ) . name ) . toEqual (
257
- UserType . name ,
266
+ UserType . name
258
267
) ;
259
268
expect ( mutations . removeUser . args ) . toEqual ( [
260
269
expect . objectContaining ( {
261
270
name : 'id' ,
262
271
type : new GraphQLNonNull ( GraphQLID ) ,
263
272
} ) ,
264
273
] ) ;
274
+ expect ( ( mutations . deleteUser . type as GraphQLObjectType ) . name ) . toEqual (
275
+ UserType . name
276
+ ) ;
277
+ expect ( mutations . deleteUser . args ) . toEqual ( [
278
+ expect . objectContaining ( {
279
+ name : 'id' ,
280
+ type : new GraphQLNonNull ( GraphQLID ) ,
281
+ } ) ,
282
+ ] ) ;
265
283
} ) ;
266
284
267
285
test ( 'creates the mutation *Input type for createMany' , ( ) => {
0 commit comments