File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -217,15 +217,12 @@ export function sequelizeConnection({
217217 if ( args . first || args . last ) {
218218 options . limit = parseInt ( args . first || args . last , 10 ) ;
219219 }
220- if ( ! args . orderBy ) {
221- args . orderBy = [
222- [ model . primaryKeyAttribute , 'ASC' ]
223- ] ;
224- } else if ( orderByEnum && typeof args . orderBy === 'string' ) {
225- args . orderBy = [ orderByEnum . _nameLookup [ args . orderBy ] . value ] ;
220+
221+ let orderBy = args . orderBy || [ [ model . primaryKeyAttribute , 'ASC' ] ] ;
222+ if ( orderByEnum && typeof orderBy === 'string' ) {
223+ orderBy = [ orderByEnum . _nameLookup [ args . orderBy ] . value ] ;
226224 }
227225
228- let orderBy = args . orderBy ;
229226 let orderAttribute = orderByAttribute ( orderBy [ 0 ] [ 0 ] , {
230227 source : info . source ,
231228 args,
You can’t perform that action at this time.
0 commit comments