Skip to content

Commit 4b7da61

Browse files
committed
fix: bad query for paginating reactions.
1 parent c104c50 commit 4b7da61

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/queries.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ const userInfo = node('user')
1818
.addChild(node('name'))
1919
.addChild(node('url'))
2020

21+
const reactorSubQ = node('nodes')
22+
.addChild(node('id'))
23+
.addChild(node('createdAt'))
24+
.addChild(userInfo)
25+
2126
const reactorQ = node('reactions', {first: 10})
2227
.addChild(pagination)
23-
.addChild(node('nodes')
24-
.addChild(node('id'))
25-
.addChild(node('createdAt'))
26-
.addChild(userInfo))
28+
.addChild(reactorSubQ)
2729

2830
const authoredQ = node('nodes')
2931
.addChild(node('id'))
@@ -315,35 +317,35 @@ const cleanRepo = async (token, result, before, after, verbose) => {
315317
acc: cc => cc.reactions.nodes,
316318
type: 'CommitComment',
317319
key: 'reactions',
318-
query: reactorQ
320+
query: reactorSubQ
319321
})).concat(await depaginateAll(issueComments, {
320322
token,
321323
name: 'issue comment reactions cont',
322324
acc: ic => ic.reactions.nodes,
323325
type: 'IssueComment',
324326
key: 'reactions',
325-
query: reactorQ
327+
query: reactorSubQ
326328
})).concat(await depaginateAll(prComments, {
327329
token,
328330
name: 'pr comment reactions cont',
329331
acc: prc => prc.reactions.nodes,
330332
type: 'PullRequestComment',
331333
key: 'reactions',
332-
query: reactorQ
334+
query: reactorSubQ
333335
})).concat(await depaginateAll(issues, {
334336
token,
335337
name: 'issue reactions cont',
336338
acc: is => is.reactions.nodes,
337339
type: 'Issue',
338340
key: 'reactions',
339-
query: participantsQ
341+
query: reactorSubQ
340342
})).concat(await depaginateAll(prs, {
341343
token,
342344
name: 'pullrequest reactions cont',
343345
acc: pr => pr.reactions.nodes,
344346
type: 'PullRequest',
345347
key: 'reactions',
346-
query: participantsQ
348+
query: reactorSubQ
347349
}))
348350

349351
return {

0 commit comments

Comments
 (0)