@@ -107,28 +107,28 @@ const QueryType = new GraphQLObjectType({
107107
108108test ( 'creates one type per data type' , ( ) => {
109109 const typeMap = getSchemaFromData (
110- data ,
110+ data
111111 ) . getTypeMap ( ) as ObjMap < GraphQLObjectType > ;
112112 expect ( typeMap . Post . name ) . toEqual ( PostType . name ) ;
113113 expect ( Object . keys ( typeMap . Post . getFields ( ) ) ) . toEqual (
114- Object . keys ( PostType . getFields ( ) ) ,
114+ Object . keys ( PostType . getFields ( ) )
115115 ) ;
116116 expect ( typeMap . User . name ) . toEqual ( UserType . name ) ;
117117 expect ( Object . keys ( typeMap . User . getFields ( ) ) ) . toEqual (
118- Object . keys ( UserType . getFields ( ) ) ,
118+ Object . keys ( UserType . getFields ( ) )
119119 ) ;
120120} ) ;
121121
122122test ( 'creates one field per relationship' , ( ) => {
123123 const typeMap = getSchemaFromData (
124- data ,
124+ data
125125 ) . getTypeMap ( ) as ObjMap < GraphQLObjectType > ;
126126 expect ( Object . keys ( typeMap . Post . getFields ( ) ) ) . toContain ( 'User' ) ;
127127} ) ;
128128
129129test ( 'creates one field per reverse relationship' , ( ) => {
130130 const typeMap = getSchemaFromData (
131- data ,
131+ data
132132 ) . getTypeMap ( ) as ObjMap < GraphQLObjectType > ;
133133 expect ( Object . keys ( typeMap . User . getFields ( ) ) ) . toContain ( 'Posts' ) ;
134134} ) ;
@@ -137,7 +137,7 @@ test('creates three query fields per data type', () => {
137137 // biome-ignore lint/style/noNonNullAssertion: It's only a test
138138 const queries = getSchemaFromData ( data ) . getQueryType ( ) ! . getFields ( ) ;
139139 expect ( ( queries . Post . type as GraphQLObjectType ) . name ) . toEqual (
140- PostType . name ,
140+ PostType . name
141141 ) ;
142142 expect ( queries . Post . args ) . toEqual ( [
143143 expect . objectContaining ( {
@@ -159,7 +159,7 @@ test('creates three query fields per data type', () => {
159159 expect ( queries . _allPostsMeta . type . toString ( ) ) . toEqual ( 'ListMetadata' ) ;
160160
161161 expect ( ( queries . User . type as GraphQLObjectType ) . name ) . toEqual (
162- UserType . name ,
162+ UserType . name
163163 ) ;
164164 expect ( queries . User . args ) . toEqual ( [
165165 expect . objectContaining ( {
@@ -185,7 +185,7 @@ test('creates three mutation fields per data type', () => {
185185 // biome-ignore lint/style/noNonNullAssertion: It's only a test
186186 const mutations = getSchemaFromData ( data ) . getMutationType ( ) ! . getFields ( ) ;
187187 expect ( ( mutations . createPost . type as GraphQLObjectType ) . name ) . toEqual (
188- PostType . name ,
188+ PostType . name
189189 ) ;
190190 expect ( mutations . createPost . args ) . toEqual ( [
191191 expect . objectContaining ( {
@@ -202,7 +202,7 @@ test('creates three mutation fields per data type', () => {
202202 } ) ,
203203 ] ) ;
204204 expect ( ( mutations . updatePost . type as GraphQLObjectType ) . name ) . toEqual (
205- PostType . name ,
205+ PostType . name
206206 ) ;
207207 expect ( mutations . updatePost . args ) . toEqual ( [
208208 expect . objectContaining ( {
@@ -223,16 +223,25 @@ test('creates three mutation fields per data type', () => {
223223 } ) ,
224224 ] ) ;
225225 expect ( ( mutations . removePost . type as GraphQLObjectType ) . name ) . toEqual (
226- PostType . name ,
226+ PostType . name
227227 ) ;
228228 expect ( mutations . removePost . args ) . toEqual ( [
229229 expect . objectContaining ( {
230230 name : 'id' ,
231231 type : new GraphQLNonNull ( GraphQLID ) ,
232232 } ) ,
233233 ] ) ;
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+ ] ) ;
234243 expect ( ( mutations . createUser . type as GraphQLObjectType ) . name ) . toEqual (
235- UserType . name ,
244+ UserType . name
236245 ) ;
237246 expect ( mutations . createUser . args ) . toEqual ( [
238247 expect . objectContaining ( {
@@ -241,7 +250,7 @@ test('creates three mutation fields per data type', () => {
241250 } ) ,
242251 ] ) ;
243252 expect ( ( mutations . updateUser . type as GraphQLObjectType ) . name ) . toEqual (
244- UserType . name ,
253+ UserType . name
245254 ) ;
246255 expect ( mutations . updateUser . args ) . toEqual ( [
247256 expect . objectContaining ( {
@@ -254,14 +263,23 @@ test('creates three mutation fields per data type', () => {
254263 } ) ,
255264 ] ) ;
256265 expect ( ( mutations . removeUser . type as GraphQLObjectType ) . name ) . toEqual (
257- UserType . name ,
266+ UserType . name
258267 ) ;
259268 expect ( mutations . removeUser . args ) . toEqual ( [
260269 expect . objectContaining ( {
261270 name : 'id' ,
262271 type : new GraphQLNonNull ( GraphQLID ) ,
263272 } ) ,
264273 ] ) ;
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+ ] ) ;
265283} ) ;
266284
267285test ( 'creates the mutation *Input type for createMany' , ( ) => {
0 commit comments