diff --git a/packages/graphql-server/src/rowDiffs/rowDiff.resolver.ts b/packages/graphql-server/src/rowDiffs/rowDiff.resolver.ts index e18696cc..271772e2 100644 --- a/packages/graphql-server/src/rowDiffs/rowDiff.resolver.ts +++ b/packages/graphql-server/src/rowDiffs/rowDiff.resolver.ts @@ -84,7 +84,7 @@ export class RowDiffResolver { const rows = await getRowsForDiff(query, { ...dbArgs, tableName, - refName: toCommitId, + refName: fromCommitId, }); return fromOneSidedTable(rows, "dropped", args.filterByRowType); } @@ -92,7 +92,7 @@ export class RowDiffResolver { const rows = await getRowsForDiff(query, { ...dbArgs, tableName, - refName: fromCommitId, + refName: toCommitId, }); return fromOneSidedTable(rows, "added", args.filterByRowType); } @@ -153,10 +153,10 @@ async function resolveRefs( type?: CommitDiffType, ): Promise<{ fromCommitId: string; toCommitId: string }> { if (type === CommitDiffType.ThreeDot) { - const fromCommitId = await query(hashOf, [fromRefName]); - const toCommitId = await query(mergeBase, [toRefName, fromRefName]); + const toCommitId = await query(hashOf, [fromRefName]); + const mergeBaseCommit = await query(mergeBase, [toRefName, fromRefName]); return { - fromCommitId: Object.values(fromCommitId[0])[0], + fromCommitId: Object.values(mergeBaseCommit[0])[0], toCommitId: Object.values(toCommitId[0])[0], }; } diff --git a/packages/web/lib/urls.ts b/packages/web/lib/urls.ts index bcba5f72..87685ee8 100644 --- a/packages/web/lib/urls.ts +++ b/packages/web/lib/urls.ts @@ -84,13 +84,11 @@ export const releases = (p: ps.OptionalRefParams): Route => database(p).addStatic("releases").withQuery({ refName: p.refName }); export const pulls = (p: ps.PullParams): Route => - database(p) - .addStatic("pulls") - .withQuery({ - refName: p.refName, - from: p.fromBranchName, - to: p.toBranchName, - }); + database(p).addStatic("pulls").withQuery({ + refName: p.refName, + from: p.fromBranchName, + to: p.toBranchName, + }); export const newRelease = (p: ps.OptionalRefParams): Route => releases(p).addStatic("new").withQuery({ refName: p.refName });