@@ -48,7 +48,7 @@ import {
4848} from '../types'
4949import { IssueExternalData , issueDetails } from './githubTypes'
5050import { GithubIssueData , IssueSyncManagerBase , IssueUpdate , WithMarkup } from './issueBase'
51- import { getSince , gqlp , guessStatus , isGHWriteAllowed , syncRunner } from './utils'
51+ import { ensureGraphQLOctokit , getSince , gqlp , guessStatus , isGHWriteAllowed , syncRunner } from './utils'
5252
5353export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncManager {
5454 createPromise : Promise < IssueExternalData | undefined > | undefined
@@ -608,6 +608,8 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
608608 okit : Octokit ,
609609 account : PersonId
610610 ) : Promise < boolean > {
611+ const graphqlOkit = ensureGraphQLOctokit ( okit , container )
612+
611613 const { state, stateReason, body, ...issueUpdate } = await this . collectIssueUpdate (
612614 info ,
613615 existing ,
@@ -624,7 +626,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
624626 // We should allow modification from user.
625627
626628 const closeIssue = async ( ) : Promise < void > => {
627- await okit . graphql (
629+ await graphqlOkit . graphql (
628630 `
629631 mutation closeIssue($issue: ID!) {
630632 closeIssue(input: {
@@ -642,7 +644,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
642644 }
643645
644646 const reopenIssue = async ( ) : Promise < void > => {
645- await okit . graphql (
647+ await graphqlOkit . graphql (
646648 `
647649 mutation reopenIssue($issue: ID!) {
648650 reopenIssue(input: {
@@ -675,7 +677,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
675677 // We need to call re-open issue
676678 await reopenIssue ( )
677679 }
678- await okit . graphql (
680+ await graphqlOkit . graphql (
679681 `
680682 mutation updateIssue($issue: ID!, $body: String! ) {
681683 updateIssue(input: {
@@ -713,7 +715,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
713715 await reopenIssue ( )
714716 }
715717 if ( hasOtherChanges ) {
716- await okit . graphql (
718+ await graphqlOkit . graphql (
717719 `
718720 mutation updateIssue($issue: ID!) {
719721 updateIssue(input: {
@@ -751,7 +753,10 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
751753 ) : Promise < IssueExternalData | undefined > {
752754 const existingIssue = existing
753755
754- const okit = ( await this . provider . getOctokit ( ctx , existingIssue . modifiedBy ) ) ?? container . container . octokit
756+ const okit = ensureGraphQLOctokit (
757+ ( await this . provider . getOctokit ( ctx , existingIssue . modifiedBy ) ) ?? container . container . octokit ,
758+ container
759+ )
755760
756761 const repoId = repository . nodeId
757762
@@ -797,7 +802,10 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
797802 account : PersonId ,
798803 id : string
799804 ) : Promise < void > {
800- const okit = ( await this . provider . getOctokit ( ctx , account ) ) ?? container . container . octokit
805+ const okit = ensureGraphQLOctokit (
806+ ( await this . provider . getOctokit ( ctx , account ) ) ?? container . container . octokit ,
807+ container
808+ )
801809
802810 const q = `mutation deleteIssue($issueID: ID!) {
803811 deleteIssue(
0 commit comments