1

GraphQL Query I used:

mutation CreateGitProfileRepo($name: String!, $description: String!, $homepageUrl: URI!) {
    createRepository(input: {name: $name, visibility: PUBLIC, description: $description, homepageUrl: $homepageUrl}) {
        repository {
            ref(qualifiedName: "main") {
                repository {
                    id
                }
            }
        }
    }
}

I'm getting ref ID as null, as it is an empty repo.

Now I'm creating a commit using:

mutation ($input: CreateCommitOnBranchInput!) {
    createCommitOnBranch(input: $input) {
        commit {
            url
        }
    }
}

here expectedHeadOid is a required field, and my ref id is comming as null,

How to create a commit in this repo. I've created new Repository using GitHub Graphql API.

Ritik
  • 137
  • 1
  • 12

0 Answers0