We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d708b7 commit bdd8defCopy full SHA for bdd8def
1 file changed
src/relay.js
@@ -217,15 +217,12 @@ export function sequelizeConnection({
217
if (args.first || args.last) {
218
options.limit = parseInt(args.first || args.last, 10);
219
}
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];
+
+ let orderBy = args.orderBy || [[model.primaryKeyAttribute, 'ASC']];
+ if (orderByEnum && typeof orderBy === 'string') {
+ orderBy = [orderByEnum._nameLookup[args.orderBy].value];
226
227
228
- let orderBy = args.orderBy;
229
let orderAttribute = orderByAttribute(orderBy[0][0], {
230
source: info.source,
231
args,
0 commit comments