Repository Archiving & Unarchiving with GitHub GRAPHQL API sample code.
query FindRepoID {
query FindRepoID { | |
repository(owner:"[github user or org]", name:"[repository]"){ | |
id, | |
isArchived, | |
} | |
} |
{ | |
"query": "query ($org: String!, $repo: String!) {repository(owner: $org, name: $repo) { id isArchived } }", | |
"variables": { | |
"org": "[github user or org]", | |
"repo": "[repository]" | |
} | |
} |
{ | |
"query": "mutation UnArchiveRepository ($mutationId: String!, $repoID: String!) {unarchiveRepository(input:{clientMutationId:$mutationId, repositoryId:$repoID}) {repository { isArchived, description } } }", | |
"variables": { | |
"mutationId": "true", | |
"repoID": "[repo id]" | |
} | |
} |
{ | |
"query": "mutation ArchiveRepository ($mutationId: String!, $repoID: String!) {archiveRepository(input:{clientMutationId:$mutationId, repositoryId:$repoID}) {repository { isArchived, description } } }", | |
"variables": { | |
"mutationId": "true", | |
"repoID": "[repo id]" | |
} | |
} |
mutation UnArchiveRepository { | |
unarchiveRepository(input:{clientMutationId:"true",repositoryId:"[insert ID]"}) { | |
repository { | |
isArchived, | |
description | |
} | |
} | |
} |
mutation ArchiveRepository { | |
archiveRepository(input:{clientMutationId:"true",repositoryId:"[repositoryID]"}) { | |
repository { | |
isArchived, | |
description, | |
} | |
} | |
} |
query FindRepoID($name: String!, $owner: String!) { | |
repository(owner: $owner, name: $name) { | |
id, | |
isArchived | |
} | |
} |
Repository Archiving & Unarchiving with GitHub GRAPHQL API sample code.
query FindRepoID {
Code examples for lotharschulz.info - How to: Nulls and Exceptions in Kotlin from github.com/lotharschulz/kotlin-null
fun reciprocal(i: Int): Double =
when(i == 0){
true -> throw IllegalArgumentException("Can not take reciprocal of 0.")
aws cli