Skip to content

Commit 5d56de9

Browse files
committed
support after for relay connections
1 parent 1f8b813 commit 5d56de9

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/relay.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,17 @@ export function nodeType(connectionType) {
105105
return connectionType._fields.edges.type.ofType._fields.node.type;
106106
}
107107

108-
export function sequelizeConnection({name, nodeType, target, orderBy: orderByEnum, before, connectionFields, edgeFields, where}) {
108+
export function sequelizeConnection({
109+
name,
110+
nodeType,
111+
target,
112+
orderBy: orderByEnum,
113+
before,
114+
after,
115+
connectionFields,
116+
edgeFields,
117+
where
118+
}) {
109119
const {
110120
edgeType,
111121
connectionType
@@ -130,6 +140,7 @@ export function sequelizeConnection({name, nodeType, target, orderBy: orderByEnu
130140
}
131141

132142
before = before || ((options) => options);
143+
after = after || ((result) => result);
133144

134145
let $connectionArgs = {
135146
...connectionArgs,
@@ -288,7 +299,7 @@ export function sequelizeConnection({name, nodeType, target, orderBy: orderByEnu
288299
}
289300
}
290301

291-
return {
302+
return after({
292303
source,
293304
args,
294305
where: argsToWhere(args),
@@ -299,7 +310,7 @@ export function sequelizeConnection({name, nodeType, target, orderBy: orderByEnu
299310
hasNextPage: hasNextPage,
300311
hasPreviousPage: hasPreviousPage
301312
}
302-
};
313+
});
303314
}
304315
});
305316

0 commit comments

Comments
 (0)