@@ -185,7 +185,7 @@ const generateInsertArray = (
185185 const input = remapFromGraphQLArrayInput ( args . values , table ) ;
186186 if ( ! input . length ) throw new GraphQLError ( 'No values were provided!' ) ;
187187
188- const columns = extractSelectedColumnsSQLFormat ( info , queryName , table ) as Record < string , PgColumn > ;
188+ const columns = extractSelectedColumnsSQLFormat ( info , info . fieldName , table ) as Record < string , PgColumn > ;
189189
190190 const result = await db . insert ( table ) . values ( input ) . returning ( columns ) . onConflictDoNothing ( ) ;
191191
@@ -222,7 +222,7 @@ const generateInsertSingle = (
222222 try {
223223 const input = remapFromGraphQLSingleInput ( args . values , table ) ;
224224
225- const columns = extractSelectedColumnsSQLFormat ( info , queryName , table ) as Record < string , PgColumn > ;
225+ const columns = extractSelectedColumnsSQLFormat ( info , info . fieldName , table ) as Record < string , PgColumn > ;
226226
227227 const result = await db . insert ( table ) . values ( input ) . returning ( columns ) . onConflictDoNothing ( ) ;
228228
@@ -265,7 +265,7 @@ const generateUpdate = (
265265 try {
266266 const { where, set } = args ;
267267
268- const columns = extractSelectedColumnsSQLFormat ( info , queryName , table ) as Record < string , PgColumn > ;
268+ const columns = extractSelectedColumnsSQLFormat ( info , info . fieldName , table ) as Record < string , PgColumn > ;
269269 const input = remapFromGraphQLSingleInput ( set , table ) ;
270270 if ( ! Object . keys ( input ) . length ) throw new GraphQLError ( 'Unable to update with no values specified!' ) ;
271271
@@ -312,7 +312,7 @@ const generateDelete = (
312312 try {
313313 const { where } = args ;
314314
315- const columns = extractSelectedColumnsSQLFormat ( info , queryName , table ) as Record < string , PgColumn > ;
315+ const columns = extractSelectedColumnsSQLFormat ( info , info . fieldName , table ) as Record < string , PgColumn > ;
316316
317317 let query = db . delete ( table ) ;
318318 if ( where ) {
0 commit comments