0

I am trying to create a new repository based on a template using the Github GraphQL api. I am using the mutation notation in combination with some custom variables. I know there is a 'cloneTemplateRepository' call which accepts some input. However I can't seem to figure out how to add collaborators to this newly created repository.

This is my mutation call so far:

mutation Mutation ($ownerId: ID!, $newRepoName: String!, $templateID: ID!){

    cloneTemplateRepository(input: {ownerId: $ownerId, name: $newRepoName, visibility: PRIVATE, repositoryId: $templateID}) {
        repository {
            owner {
                id
            }
            collaborators(first: 10) {
                nodes {
                    name
                }
            }
        }
    }
}

I know that I can get the currently assigned collaborators from a existing repository as can be seen above. But I do not know how to add new collaborators to this 'cloneTemplateRepository' mutation. Thanks in advance!!

FalcoVerhagen
  • 154
  • 1
  • 8

0 Answers0