@devries-cameron20 / t3code-1 / commits / 596752cffe
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

perf(server): GitHub activity reads skip PR-wide fields on later review-thread pages (8.9 s → 6.8 s median) (#30294)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>

Andrei committed Nov 6, 2026 at 12:23 UTC 596752cffe9fa1cce1c27159bfabe777fa45046f
5 files changed +265 -176
packages/source-control-github/src/server/GitHubPullRequestApi.test.ts
+64 -66
@@ -338,13 +338,14 @@ function threadComments(
338 ids: ReadonlyArray<string>,
339 endCursor: string | null,
340 totalCount = ids.length,
341 + author: Readonly<Record<string, unknown>> | null = null,
342 ) {
343 return {
344 totalCount,
345 pageInfo: { hasNextPage: endCursor !== null, endCursor },
346 nodes: ids.map((id) => ({
347 id,
347 - author: null,
348 + author,
349 body: id,
350 createdAt: "2026-07-01T00:00:00Z",
351 lastEditedAt: null,
@@ -3455,67 +3456,31 @@ layer("GitHubPullRequestApi.layer", (it) => {
3456 }),
3457 );
3458
3458 - it.effect.each([false, true])(
3459 - "keeps thread cursors and reviewers after a refusal (later page: %s)",
3460 - (later) =>
3461 - Effect.gen(function* () {
3462 - if (later)
3463 - mockedExecute.mockReturnValueOnce(
3464 - Effect.succeed(
3465 - output(
3466 - reviewThreadsPage([thread("T1", "c1")], "next", [
3467 - {
3468 - __typename: "User",
3469 - login: "prior",
3470 - name: null,
3471 - avatarUrl: "https://avatars/prior",
3472 - },
3473 - ]),
3474 - ),
3475 - ),
3476 - );
3477 - mockedExecute.mockReturnValueOnce(refusedReviewerResponse());
3478 - mockedExecute.mockReturnValueOnce(
3479 - Effect.succeed(output(reviewThreadsPage([thread("T2", "c2")], "last"))),
3480 - );
3481 - mockedExecute.mockReturnValueOnce(
3482 - Effect.succeed(output(reviewThreadsPage([thread("T3", "c3")], null))),
3483 - );
3484 - const cli = yield* GitHubPullRequestApi.GitHubPullRequestApi;
3485 - const read = cli.listReviewThreadComments({
3486 - ...pullRequestInput,
3487 - repository: `acme/refused-threads-${later}`,
3488 - });
3489 - const conversation = yield* read;
3490 - expect(
3491 - variablesOf("ReviewThreads").map((v) => [v["after"], v["requestedReviewers"]]),
3492 - ).toEqual(
3493 - later
3494 - ? [
3495 - [null, 50],
3496 - ["next", 50],
3497 - ["next", 0],
3498 - ["last", 0],
3499 - ]
3500 - : [
3501 - [null, 50],
3502 - [null, 0],
3503 - ["last", 0],
3504 - ],
3505 - );
3506 - expect(conversation.comments.map((c) => c.id)).toEqual(
3507 - later ? ["c1", "c2", "c3"] : ["c2", "c3"],
3508 - );
3509 - expect(conversation.reviewers.map((r) => r.login)).toEqual(later ? ["prior"] : []);
3510 - expect(conversation.truncated).toBe(false);
3511 -
3512 - mockedExecute.mockReturnValueOnce(Effect.succeed(output(reviewThreadsPage([], null))));
3513 - yield* read;
3514 - expect(variablesOf("ReviewThreads").at(-1)).toMatchObject({
3515 - after: null,
3516 - requestedReviewers: 0,
3517 - });
3518 - }),
3459 + it.effect("keeps thread cursors after a reviewer refusal", () =>
3460 + Effect.gen(function* () {
3461 + mockedExecute.mockReturnValueOnce(refusedReviewerResponse());
3462 + mockedExecute.mockReturnValueOnce(
3463 + Effect.succeed(output(reviewThreadsPage([thread("T2", "c2")], "last"))),
3464 + );
3465 + mockedExecute.mockReturnValueOnce(
3466 + Effect.succeed(output(reviewThreadsPage([thread("T3", "c3")], null))),
3467 + );
3468 + const cli = yield* GitHubPullRequestApi.GitHubPullRequestApi;
3469 + const read = cli.listReviewThreadComments({
3470 + ...pullRequestInput,
3471 + repository: "acme/refused-threads",
3472 + });
3473 + const conversation = yield* read;
3474 + expect(variablesOf("ReviewThreads").map((v) => v["requestedReviewers"])).toEqual([50, 0]);
3475 + expect(variablesOf("ReviewThreadPages").map((v) => v["after"])).toEqual(["last"]);
3476 + expect(conversation.comments.map((c) => c.id)).toEqual(["c2", "c3"]);
3477 + expect(conversation.reviewers).toEqual([]);
3478 + expect(conversation.truncated).toBe(false);
3479 +
3480 + mockedExecute.mockReturnValueOnce(Effect.succeed(output(reviewThreadsPage([], null))));
3481 + yield* read;
3482 + expect(variablesOf("ReviewThreads").at(-1)).toMatchObject({ requestedReviewers: 0 });
3483 + }),
3484 );
3485
3486 it.effect("decodes reviewers, labels and workflow checks without another detail read", () =>
@@ -3767,10 +3732,32 @@ layer("GitHubPullRequestApi.layer", (it) => {
3732 it.effect("follows the cursor to the review threads the first page left behind", () =>
3733 Effect.gen(function* () {
3734 mockedExecute.mockReturnValueOnce(
3770 - Effect.succeed(output(reviewThreadsPage([thread("PRRT_1", "c1")], "Y3Vyc29yOjE"))),
3735 + Effect.succeed(
3736 + output(
3737 + reviewThreadsPage([thread("PRRT_1", "c1")], "Y3Vyc29yOjE", [
3738 + { __typename: "User", login: "prior", name: null, avatarUrl: "https://avatars/p" },
3739 + ]),
3740 + ),
3741 + ),
3742 );
3743 mockedExecute.mockReturnValueOnce(
3773 - Effect.succeed(output(reviewThreadsPage([thread("PRRT_2", "c2")], null))),
3744 + Effect.succeed(
3745 + output(
3746 + reviewThreadsPage(
3747 + [
3748 + {
3749 + ...thread("PRRT_2", "c2"),
3750 + comments: threadComments(["c2"], null, 1, {
3751 + __typename: "Bot",
3752 + login: "later-bot",
3753 + avatarUrl: "https://avatars/later-bot",
3754 + }),
3755 + },
3756 + ],
3757 + null,
3758 + ),
3759 + ),
3760 + ),
3761 );
3762 const cli = yield* GitHubPullRequestApi.GitHubPullRequestApi;
3763
@@ -3781,9 +3768,20 @@ layer("GitHubPullRequestApi.layer", (it) => {
3768 number: 7,
3769 });
3770
3784 - expect(varsAt(0)["after"]).toBeNull();
3785 - expect(varsAt(1)["after"]).toBe("Y3Vyc29yOjE");
3771 + expect(callAt(0)).toMatchObject({ operationName: "ReviewThreads" });
3772 + // Later pages ask for the threads alone and keep the first page's PR-wide fields.
3773 + const later = callAt(1);
3774 + assert(later.kind === "graphql");
3775 + expect(later).toMatchObject({
3776 + operationName: "ReviewThreadPages",
3777 + variables: { after: "Y3Vyc29yOjE" },
3778 + });
3779 + for (const field of ["reviewRequests", "commits(", "reviewDismissals", "latestReviews"])
3780 + expect(later.query).not.toContain(field);
3781 expect(conversation.comments.map((comment) => comment.id)).toEqual(["c1", "c2"]);
3782 + expect(conversation.reviewers.map((reviewer) => reviewer.login)).toEqual(["prior"]);
3783 + expect(conversation.avatarsByLogin.get("later-bot")).toBe("https://avatars/later-bot");
3784 + expect(conversation.botLogins.has("later-bot")).toBe(true);
3785 assert.isFalse(conversation.truncated);
3786 }),
3787 );
packages/source-control-github/src/server/GitHubPullRequestApi.ts
+32 -38
@@ -33,7 +33,6 @@ import {
33 type PullRequestListState,
34 type PullRequestMergeMethod,
35 type PullRequestOmittedFileStat,
36 - type PullRequestReaction,
36 type PullRequestReactionContent,
37 type PullRequestReviewCommentDraft,
38 type PullRequestReviewVerdict,
@@ -95,6 +94,7 @@ import {
94 toReviewDismissalsPage,
95 toReviewerCandidates,
96 toReviewThreadCommentsPage,
97 + toLaterReviewThreadPage,
98 toReviewThreadPage,
99 toStackMembership,
100 toViewerPermissions,
@@ -2216,45 +2216,39 @@ export const make = Effect.gen(function* () {
2216 function* (input) {
2217 const { owner, name } = parseRepositorySelector(input.repository);
2218 const target = { ...input, operation: "listReviewThreadComments" };
2219 - const threadPage = (
2220 - after: string | null,
2221 - ): Effect.Effect<GitHubReviewThreadPage, GitHubPullRequestApiError> =>
2222 - readRequestedReviewers(input, 50, (requestedReviewers) =>
2223 - client.ReviewThreads({ owner, name, number: input.number, after, requestedReviewers }),
2224 - ).pipe(graphql(target), Effect.map(toReviewThreadPage), Effect.flatMap(found(target)));
2225 - const entries: GitHubReviewThreadEntry[] = [];
2226 - const avatarsByLogin = new Map<string, string>();
2227 - const botLogins = new Set<string>();
2228 - let reviewers: ReadonlyArray<PullRequestActor> = [];
2229 - let reactions: GitHubReviewThreadPage["reactions"] = [];
2230 - const reactionsById = new Map<string, ReadonlyArray<PullRequestReaction>>();
2231 - const editedAtById = new Map<string, string>();
2232 - let commits: GitHubReviewThreadPage["commits"] = [];
2233 - let viewer: GitHubReviewThreadPage["viewer"] = { canUpdate: true, didAuthor: false };
2234 - const dismissalsByReviewId = new Map<string, string>();
2235 - let dismissalCursor: string | null = null;
2236 - let cursor: string | null = null;
2237 - let page = 0;
2238 - do {
2239 - const read: GitHubReviewThreadPage = yield* threadPage(cursor);
2240 - entries.push(...read.threads);
2241 - for (const login of read.botLogins) botLogins.add(login);
2242 - for (const [login, avatarUrl] of read.avatarsByLogin)
2219 + const first: GitHubReviewThreadPage = yield* readRequestedReviewers(
2220 + input,
2221 + 50,
2222 + (requestedReviewers) =>
2223 + client.ReviewThreads({ owner, name, number: input.number, requestedReviewers }),
2224 + ).pipe(graphql(target), Effect.map(toReviewThreadPage), Effect.flatMap(found(target)));
2225 + const entries: GitHubReviewThreadEntry[] = [...first.threads];
2226 + const avatarsByLogin = new Map(first.avatarsByLogin);
2227 + const botLogins = new Set(first.botLogins);
2228 + const { reviewers, reactions, reactionsById, editedAtById, commits, viewer } = first;
2229 + const dismissalsByReviewId = new Map(first.dismissalsByReviewId);
2230 + const dismissalCursor = first.nextDismissalCursor;
2231 + let cursor = first.nextCursor;
2232 + let page = 1;
2233 + // Later pages carry the threads alone; the PR-wide fields above come from the first.
2234 + while (cursor !== null && page < REVIEW_THREAD_PAGES) {
2235 + const later: Pick<
2236 + GitHubReviewThreadPage,
2237 + "threads" | "nextCursor" | "avatarsByLogin" | "botLogins"
2238 + > = yield* client
2239 + .ReviewThreadPages({ owner, name, number: input.number, after: cursor })
2240 + .pipe(
2241 + graphql(target),
2242 + Effect.map(toLaterReviewThreadPage),
2243 + Effect.flatMap(found(target)),
2244 + );
2245 + entries.push(...later.threads);
2246 + for (const login of later.botLogins) botLogins.add(login);
2247 + for (const [login, avatarUrl] of later.avatarsByLogin)
2248 avatarsByLogin.set(login, avatarUrl);
2244 - if (page === 0) {
2245 - reviewers = read.reviewers;
2246 - reactions = read.reactions;
2247 - for (const [id, entry] of read.reactionsById) reactionsById.set(id, entry);
2248 - for (const [id, editedAt] of read.editedAtById) editedAtById.set(id, editedAt);
2249 - commits = read.commits;
2250 - viewer = read.viewer;
2251 - for (const [id, message] of read.dismissalsByReviewId)
2252 - dismissalsByReviewId.set(id, message);
2253 - dismissalCursor = read.nextDismissalCursor;
2254 - }
2255 - cursor = read.nextCursor;
2249 + cursor = later.nextCursor;
2250 page += 1;
2257 - } while (cursor !== null && page < REVIEW_THREAD_PAGES);
2251 + }
2252
2253 if (dismissalCursor !== null) {
2254 let after: string | null = dismissalCursor;
packages/source-control-github/src/server/gitHubPullRequestJson.ts
+47 -17
@@ -75,6 +75,8 @@ import type {
75 ReactionGroup,
76 ReviewDismissals,
77 ReviewThreadComments,
78 + ReviewThreadPage,
79 + ReviewThreadPages,
80 ReviewThreads,
81 ThreadComment,
82 } from "./pullRequestReviews.graphql.ts";
@@ -1313,11 +1315,8 @@ type ReviewThreadsPullRequest = NonNullable<
1315 NonNullable<ReviewThreads.Result["repository"]>["pullRequest"]
1316 >;
1317
1316 -export function toReviewThreadPage(result: ReviewThreads.Result): GitHubReviewThreadPage | null {
1317 - const pullRequest = result.repository?.pullRequest;
1318 - if (pullRequest == null) return null;
1319 - const viewer = trimmed(result.viewer.login);
1320 - const threads = pullRequest.reviewThreads;
1318 +/** A page of threads and the people commenting on them, whichever query carried it. */
1319 +function toReviewThreadEntries(threads: ReviewThreadPage, viewer: string | null) {
1320 const threadNodes = nodesOf(threads);
1321 const entries = threadNodes.flatMap((thread): ReadonlyArray<GitHubReviewThreadEntry> => {
1322 const path = trimmed(thread.path);
@@ -1341,27 +1340,58 @@ export function toReviewThreadPage(result: ReviewThreads.Result): GitHubReviewTh
1340 },
1341 ];
1342 });
1343 + return {
1344 + entries,
1345 + nextCursor: nextCursorOf(threads.pageInfo),
1346 + authors: threadNodes.flatMap((thread) =>
1347 + nodesOf(thread.comments).map((comment) => comment.author),
1348 + ),
1349 + };
1350 +}
1351 +
1352 +function collectActors(raws: ReadonlyArray<ActorFields | null | undefined>) {
1353 + const avatarsByLogin = new Map<string, string>();
1354 + const botLogins = new Set<string>();
1355 + for (const raw of raws) {
1356 + const login = trimmed(raw?.login);
1357 + const avatarUrl = trimmed(raw?.avatarUrl);
1358 + if (login !== null && avatarUrl !== null) avatarsByLogin.set(login, avatarUrl);
1359 + if (login !== null && toActor(raw)?.isBot) botLogins.add(login);
1360 + }
1361 + return { avatarsByLogin, botLogins };
1362 +}
1363 +
1364 +export function toLaterReviewThreadPage(
1365 + result: ReviewThreadPages.Result,
1366 +): Pick<GitHubReviewThreadPage, "threads" | "nextCursor" | "avatarsByLogin" | "botLogins"> | null {
1367 + const threads = result.repository?.pullRequest?.reviewThreads;
1368 + if (threads === undefined) return null;
1369 + const { entries, nextCursor, authors } = toReviewThreadEntries(
1370 + threads,
1371 + trimmed(result.viewer.login),
1372 + );
1373 + return { threads: entries, nextCursor, ...collectActors(authors) };
1374 +}
1375 +
1376 +export function toReviewThreadPage(result: ReviewThreads.Result): GitHubReviewThreadPage | null {
1377 + const pullRequest = result.repository?.pullRequest;
1378 + if (pullRequest == null) return null;
1379 + const viewer = trimmed(result.viewer.login);
1380 + const page = toReviewThreadEntries(pullRequest.reviewThreads, viewer);
1381 const requestedReviewers = nodesOf(pullRequest.reviewRequests).map(
1382 (node): ActorFields | null => node.requestedReviewer,
1383 );
1384 const latestReviews = nodesOf(pullRequest.latestReviews);
1385 const comments = nodesOf(pullRequest.comments);
1386 const reviews = nodesOf(pullRequest.reviews);
1350 - const avatarsByLogin = new Map<string, string>();
1351 - const botLogins = new Set<string>();
1352 - for (const raw of [
1387 + const { avatarsByLogin, botLogins } = collectActors([
1388 pullRequest.author,
1389 ...comments.map((node) => node.author),
1390 ...reviews.map((node) => node.author),
1391 ...requestedReviewers,
1392 ...latestReviews.map((node) => node.author),
1358 - ...threadNodes.flatMap((thread) => nodesOf(thread.comments).map((comment) => comment.author)),
1359 - ]) {
1360 - const login = trimmed(raw?.login);
1361 - const avatarUrl = trimmed(raw?.avatarUrl);
1362 - if (login !== null && avatarUrl !== null) avatarsByLogin.set(login, avatarUrl);
1363 - if (login !== null && toActor(raw)?.isBot) botLogins.add(login);
1364 - }
1393 + ...page.authors,
1394 + ]);
1395 const reviewers = new Map<string, PullRequestActor>();
1396 for (const raw of [...requestedReviewers, ...latestReviews.map((node) => node.author)]) {
1397 const actor = toActor(raw) ?? toRequestedTeam(raw);
@@ -1391,8 +1421,8 @@ export function toReviewThreadPage(result: ReviewThreads.Result): GitHubReviewTh
1421 if (reactions.length > 0) reactionsById.set(id, reactions);
1422 }
1423 return {
1394 - threads: entries,
1395 - nextCursor: nextCursorOf(threads.pageInfo),
1424 + threads: page.entries,
1425 + nextCursor: page.nextCursor,
1426 reactions: toReactions(pullRequest.reactionGroups, viewer),
1427 reactionsById,
1428 editedAtById,
packages/source-control-github/src/server/pullRequestReviews.graphql
+51 -38
@@ -40,9 +40,39 @@ fragment ThreadComment on PullRequestReviewComment {
40 ...Reactions
41 }
42
43 -# One page of review threads with their comments, and the people on the review. `$after` is null
44 -# for the first page and the last page's `endCursor` after that, so a pull request with more
45 -# threads than one page holds is walked rather than cut off.
43 +# One page of review threads. Only ten comments ride with each thread. A hundred threads times a
44 +# hundred comments made GitHub reserve 10,000 nested rows and charge 104 points; unfinished threads
45 +# are paged from their own cursor by `ReviewThreadComments`.
46 +fragment ReviewThreadPage on PullRequestReviewThreadConnection {
47 + totalCount
48 + pageInfo {
49 + hasNextPage
50 + endCursor
51 + }
52 + nodes {
53 + id
54 + isResolved
55 + isOutdated
56 + path
57 + # Null once the thread's line has left the diff, which `isOutdated` reports.
58 + line
59 + diffSide
60 + comments(first: 10) {
61 + totalCount
62 + pageInfo {
63 + hasNextPage
64 + endCursor
65 + }
66 + nodes {
67 + ...ThreadComment
68 + }
69 + }
70 + }
71 +}
72 +
73 +# The first page of review threads with their comments, and the people on the review. Later pages
74 +# come from `ReviewThreadPages`, so a pull request with more threads than one page holds is walked
75 +# rather than cut off.
76 #
77 # `viewer` rides along: GitHub names who reacted but never says whether that is the reader, so the
78 # comparison is made locally rather than paid for with a request of its own.
@@ -53,46 +83,14 @@ fragment ThreadComment on PullRequestReviewComment {
83 #
84 # `viewerCanUpdate` and `viewerDidAuthor` belong to the pull request this query is already
85 # standing on, so what the reader may do with it arrives with the conversation.
56 -query ReviewThreads(
57 - $owner: String!
58 - $name: String!
59 - $number: Int!
60 - $after: String
61 - $requestedReviewers: Int!
62 -) {
86 +query ReviewThreads($owner: String!, $name: String!, $number: Int!, $requestedReviewers: Int!) {
87 viewer {
88 login
89 }
90 repository(owner: $owner, name: $name) {
91 pullRequest(number: $number) {
68 - reviewThreads(first: 100, after: $after) {
69 - totalCount
70 - pageInfo {
71 - hasNextPage
72 - endCursor
73 - }
74 - nodes {
75 - id
76 - isResolved
77 - isOutdated
78 - path
79 - # Null once the thread's line has left the diff, which `isOutdated` reports.
80 - line
81 - diffSide
82 - # Only ten comments ride with each thread. A hundred threads times a hundred comments
83 - # made GitHub reserve 10,000 nested rows and charge 104 points; unfinished threads are
84 - # paged from their own cursor by `ReviewThreadComments`.
85 - comments(first: 10) {
86 - totalCount
87 - pageInfo {
88 - hasNextPage
89 - endCursor
90 - }
91 - nodes {
92 - ...ThreadComment
93 - }
94 - }
95 - }
92 + reviewThreads(first: 100) {
93 + ...ReviewThreadPage
94 }
95 viewerCanUpdate
96 viewerDidAuthor
@@ -198,6 +196,21 @@ query ReviewThreads(
196 }
197 }
198
199 +# The review threads past the first page. Everything else `ReviewThreads` asks for describes the
200 +# whole pull request and arrived with that page, so later pages carry the threads alone.
201 +query ReviewThreadPages($owner: String!, $name: String!, $number: Int!, $after: String!) {
202 + viewer {
203 + login
204 + }
205 + repository(owner: $owner, name: $name) {
206 + pullRequest(number: $number) {
207 + reviewThreads(first: 100, after: $after) {
208 + ...ReviewThreadPage
209 + }
210 + }
211 + }
212 +}
213 +
214 # The rest of one thread's conversation. GraphQL pages a connection nested inside another only
215 # from the inner node itself, so a thread longer than a page is followed on its own: a request
216 # GitHub makes necessary, and one no ordinary pull request ever provokes.
packages/source-control-github/src/server/pullRequestReviews.graphql.ts
+71 -17
@@ -112,13 +112,6 @@ export const ThreadComment = Schema.Struct({
112 })
113 export interface ThreadComment extends Schema.Struct.Type<typeof ThreadComment.fields> {}
114
115 -/** A user is an individual's account on GitHub that owns repositories and can make new content. */
116 -export const ViewerUser = Schema.Struct({
117 - /** The username used to login. */
118 - login: Schema.String
119 -})
120 -export interface ViewerUser extends Schema.Struct.Type<typeof ViewerUser.fields> {}
121 -
115 /** Information about pagination in a connection. */
116 export const PageInfo = Schema.Struct({
117 /** When paginating forwards, are there more items? */
@@ -158,8 +151,12 @@ export const NodesPullRequestReviewThread = Schema.Struct({
151 })
152 export interface NodesPullRequestReviewThread extends Schema.Struct.Type<typeof NodesPullRequestReviewThread.fields> {}
153
161 -/** Review comment threads for a pull request review. */
162 -export const PullRequestReviewThreadConnection = Schema.Struct({
154 +/**
155 + * `fragment ReviewThreadPage on PullRequestReviewThreadConnection`
156 + *
157 + * Review comment threads for a pull request review.
158 + */
159 +export const ReviewThreadPage = Schema.Struct({
160 /** Identifies the total count of items in the connection. */
161 totalCount: Shared.Int,
162 /** Information to aid in pagination. */
@@ -167,7 +164,14 @@ export const PullRequestReviewThreadConnection = Schema.Struct({
164 /** A list of nodes. */
165 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(NodesPullRequestReviewThread)))
166 })
170 -export interface PullRequestReviewThreadConnection extends Schema.Struct.Type<typeof PullRequestReviewThreadConnection.fields> {}
167 +export interface ReviewThreadPage extends Schema.Struct.Type<typeof ReviewThreadPage.fields> {}
168 +
169 +/** A user is an individual's account on GitHub that owns repositories and can make new content. */
170 +export const ViewerUser = Schema.Struct({
171 + /** The username used to login. */
172 + login: Schema.String
173 +})
174 +export interface ViewerUser extends Schema.Struct.Type<typeof ViewerUser.fields> {}
175
176 /** Represents a comment on an Issue. */
177 export const IssueComment = Schema.Struct({
@@ -370,7 +374,7 @@ export interface PullRequestCommitConnection extends Schema.Struct.Type<typeof P
374 /** A repository pull request. */
375 export const ReviewThreadsRepositoryPullRequestPullRequest = Schema.Struct({
376 /** The list of all review threads for this pull request. */
373 - reviewThreads: PullRequestReviewThreadConnection,
377 + reviewThreads: ReviewThreadPage,
378 /** Check if the current viewer can update this object. */
379 viewerCanUpdate: Schema.Boolean,
380 /** Did the viewer author this comment. */
@@ -408,23 +412,22 @@ export const ReviewThreads = GraphQL.query("ReviewThreads", {
412 { name: "owner", body: "String!" },
413 { name: "name", body: "String!" },
414 { name: "number", body: "Int!" },
411 - { name: "after", body: "String" },
415 { name: "requestedReviewers", body: "Int!" }
416 ],
417 selections: [
418 { name: "viewer", body: ["{login}"] },
416 - { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){reviewThreads(first:100 after:$", "after", "){totalCount pageInfo{hasNextPage endCursor}nodes{id isResolved isOutdated path line diffSide comments(first:10){totalCount pageInfo{hasNextPage endCursor}nodes{...ThreadComment}}}}viewerCanUpdate viewerDidAuthor author{__typename login avatarUrl}...Reactions comments(first:100){nodes{id lastEditedAt author{__typename login avatarUrl}...Reactions}}reviews(first:100){nodes{id lastEditedAt author{__typename login avatarUrl}...Reactions}}reviewRequests(first:$", "requestedReviewers", "){nodes{requestedReviewer{__typename...on User{login name avatarUrl}...on Bot{login avatarUrl}...on Team{combinedSlug teamName:name teamAvatarUrl:avatarUrl}}}}latestReviews(first:50){nodes{state author{__typename login avatarUrl}}}reviewDismissals:timelineItems(itemTypes:[REVIEW_DISMISSED_EVENT]first:100){pageInfo{hasNextPage endCursor}nodes{__typename...on ReviewDismissedEvent{dismissalMessage review{id}}}}commits(last:100){nodes{commit{oid messageHeadline committedDate authors(first:3){nodes{name avatarUrl user{login}}}}}}}}"] }
419 + { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){reviewThreads(first:100){...ReviewThreadPage}viewerCanUpdate viewerDidAuthor author{__typename login avatarUrl}...Reactions comments(first:100){nodes{id lastEditedAt author{__typename login avatarUrl}...Reactions}}reviews(first:100){nodes{id lastEditedAt author{__typename login avatarUrl}...Reactions}}reviewRequests(first:$", "requestedReviewers", "){nodes{requestedReviewer{__typename...on User{login name avatarUrl}...on Bot{login avatarUrl}...on Team{combinedSlug teamName:name teamAvatarUrl:avatarUrl}}}}latestReviews(first:50){nodes{state author{__typename login avatarUrl}}}reviewDismissals:timelineItems(itemTypes:[REVIEW_DISMISSED_EVENT]first:100){pageInfo{hasNextPage endCursor}nodes{__typename...on ReviewDismissedEvent{dismissalMessage review{id}}}}commits(last:100){nodes{commit{oid messageHeadline committedDate authors(first:3){nodes{name avatarUrl user{login}}}}}}}}"] }
420 ],
421 fragments: [
419 - { name: "ThreadComment", body: ["on PullRequestReviewComment{id author{__typename login avatarUrl}body createdAt lastEditedAt url...Reactions}"] },
420 - { name: "Reactions", body: ["on Reactable{__typename reactionGroups{content viewerHasReacted reactors(first:10){totalCount nodes{__typename...on User{login}...on Bot{login}...on Organization{login}...on Mannequin{login}}}}}"] }
422 + { name: "ReviewThreadPage", body: ["on PullRequestReviewThreadConnection{totalCount pageInfo{hasNextPage endCursor}nodes{id isResolved isOutdated path line diffSide comments(first:10){totalCount pageInfo{hasNextPage endCursor}nodes{...ThreadComment}}}}"] },
423 + { name: "Reactions", body: ["on Reactable{__typename reactionGroups{content viewerHasReacted reactors(first:10){totalCount nodes{__typename...on User{login}...on Bot{login}...on Organization{login}...on Mannequin{login}}}}}"] },
424 + { name: "ThreadComment", body: ["on PullRequestReviewComment{id author{__typename login avatarUrl}body createdAt lastEditedAt url...Reactions}"] }
425 ]
426 },
427 variables: {
428 owner: Schema.String,
429 name: Schema.String,
430 number: Shared.Int,
427 - after: Schema.optional(Schema.NullOr(Schema.String)),
431 requestedReviewers: Shared.Int
432 },
433 result: Schema.Struct({
@@ -439,6 +442,57 @@ export declare namespace ReviewThreads {
442 export type Result = typeof ReviewThreads.result.Type
443 }
444
445 +/** A repository pull request. */
446 +export const ReviewThreadPagesRepositoryPullRequestPullRequest = Schema.Struct({
447 + /** The list of all review threads for this pull request. */
448 + reviewThreads: ReviewThreadPage
449 +})
450 +export interface ReviewThreadPagesRepositoryPullRequestPullRequest extends Schema.Struct.Type<typeof ReviewThreadPagesRepositoryPullRequestPullRequest.fields> {}
451 +
452 +/** A repository contains the content for a project. */
453 +export const ReviewThreadPagesRepositoryRepository = Schema.Struct({
454 + /** Returns a single pull request from the current repository by number. */
455 + pullRequest: Schema.NullOr(ReviewThreadPagesRepositoryPullRequestPullRequest)
456 +})
457 +export interface ReviewThreadPagesRepositoryRepository extends Schema.Struct.Type<typeof ReviewThreadPagesRepositoryRepository.fields> {}
458 +
459 +/** `query ReviewThreadPages` */
460 +export const ReviewThreadPages = GraphQL.query("ReviewThreadPages", {
461 + document: {
462 + variables: [
463 + { name: "owner", body: "String!" },
464 + { name: "name", body: "String!" },
465 + { name: "number", body: "Int!" },
466 + { name: "after", body: "String!" }
467 + ],
468 + selections: [
469 + { name: "viewer", body: ["{login}"] },
470 + { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){reviewThreads(first:100 after:$", "after", "){...ReviewThreadPage}}}"] }
471 + ],
472 + fragments: [
473 + { name: "ReviewThreadPage", body: ["on PullRequestReviewThreadConnection{totalCount pageInfo{hasNextPage endCursor}nodes{id isResolved isOutdated path line diffSide comments(first:10){totalCount pageInfo{hasNextPage endCursor}nodes{...ThreadComment}}}}"] },
474 + { name: "ThreadComment", body: ["on PullRequestReviewComment{id author{__typename login avatarUrl}body createdAt lastEditedAt url...Reactions}"] },
475 + { name: "Reactions", body: ["on Reactable{__typename reactionGroups{content viewerHasReacted reactors(first:10){totalCount nodes{__typename...on User{login}...on Bot{login}...on Organization{login}...on Mannequin{login}}}}}"] }
476 + ]
477 + },
478 + variables: {
479 + owner: Schema.String,
480 + name: Schema.String,
481 + number: Shared.Int,
482 + after: Schema.String
483 + },
484 + result: Schema.Struct({
485 + /** The currently authenticated user. */
486 + viewer: ViewerUser,
487 + /** Lookup a given repository by the owner and repository name. */
488 + repository: Schema.NullOr(ReviewThreadPagesRepositoryRepository)
489 + })
490 +})
491 +export declare namespace ReviewThreadPages {
492 + export type Variables = typeof ReviewThreadPages.variables.Type
493 + export type Result = typeof ReviewThreadPages.result.Type
494 +}
495 +
496 /** A repository pull request. */
497 export const ReviewThreadCommentsRepositoryPullRequestPullRequest = Schema.Struct({
498 /** The Node ID of the PullRequest object */
@@ -567,4 +621,4 @@ export declare namespace ReviewDismissals {
621 }
622
623 /** Every operation in pullRequestReviews.graphql. */
570 -export const PullRequestReviewsGraphQLGroup = GraphQLGroup.make(ReviewThreads, ReviewThreadComments, ReviewDismissals)
624 +export const PullRequestReviewsGraphQLGroup = GraphQLGroup.make(ReviewThreads, ReviewThreadPages, ReviewThreadComments, ReviewDismissals)