Skip to content

Commit 1c4ad1c

Browse files
committed
fix graphql usage
1 parent 9e212f0 commit 1c4ad1c

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/core.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ export const commitFilesFromBase64 = async ({
197197
fileChanges,
198198
});
199199

200-
const tempRefTarget = tempCommit.createCommitOnBranch?.ref?.target;
201-
const tempHeadOid =
202-
tempRefTarget?.__typename === "Commit" ? tempRefTarget.oid : null;
200+
const tempHeadOid = tempCommit.createCommitOnBranch?.commit?.oid;
203201

204202
if (!tempHeadOid) {
205203
throw new Error(

src/github/graphql/queries.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,11 @@ const DELETE_REF = /* GraphQL */ `
7878
const CREATE_COMMIT_ON_BRANCH = /* GraphQL */ `
7979
mutation createCommitOnBranch($input: CreateCommitOnBranchInput!) {
8080
createCommitOnBranch(input: $input) {
81+
commit {
82+
oid
83+
}
8184
ref {
8285
id
83-
target {
84-
... on Commit {
85-
oid
86-
}
87-
}
8886
}
8987
}
9088
}

0 commit comments

Comments
 (0)