Fix okit.graphql is not a function (#10442)

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2026-01-27 13:10:12 +07:00
committed by GitHub
parent 2446629d3c
commit 34128dfc60
8 changed files with 85 additions and 24 deletions
@@ -29,7 +29,7 @@ import {
githubSyncVersion
} from '../types'
import { ReviewComment as ReviewCommentExternalData, reviewCommentDetails } from './githubTypes'
import { collectUpdate, deleteObjects, errorToObj, isGHWriteAllowed } from './utils'
import { collectUpdate, deleteObjects, ensureGraphQLOctokit, errorToObj, isGHWriteAllowed } from './utils'
import { Analytics } from '@hcengineering/analytics'
import { PullRequestReviewCommentCreatedEvent, PullRequestReviewCommentEvent } from '@octokit/webhooks-types'
@@ -155,7 +155,10 @@ export class ReviewCommentSyncManager implements DocSyncManager {
derivedClient: TxOperations,
parent?: DocSyncInfo
): Promise<void> {
const okit = (await this.provider.getOctokit(ctx, account)) ?? container.container.octokit
const okit = ensureGraphQLOctokit(
(await this.provider.getOctokit(ctx, account)) ?? container.container.octokit,
container
)
const q = `mutation deleteReviewComment($reviewID: ID!) {
deletePullRequestReviewComment(input: {
id: $reviewID
@@ -435,7 +438,10 @@ export class ReviewCommentSyncManager implements DocSyncManager {
if (Object.keys(platformUpdate).length > 0) {
if (platformUpdate.body !== undefined) {
const body = await this.provider.getMarkupSafe(container.container, platformUpdate.body)
const okit = (await this.provider.getOctokit(ctx, account)) ?? container.container.octokit
const okit = ensureGraphQLOctokit(
(await this.provider.getOctokit(ctx, account)) ?? container.container.octokit,
container
)
const q = `mutation updateReviewComment($commentID: ID!, $body: String!) {
updatePullRequestReviewComment(input: {
threadId: $threadID
@@ -510,7 +516,10 @@ export class ReviewCommentSyncManager implements DocSyncManager {
return {}
}
const existingReview = existing as GithubReviewComment
const okit = (await this.provider.getOctokit(ctx, existingReview.modifiedBy)) ?? container.container.octokit
const okit = ensureGraphQLOctokit(
(await this.provider.getOctokit(ctx, existingReview.modifiedBy)) ?? container.container.octokit,
container
)
// No external version yet, create it.
try {