Created
April 15, 2020 11:59
-
-
Save mislav/0a8b250bb9420ebe3ca5a896a6f56f5e to your computer and use it in GitHub Desktop.
GraphQL mutation example with hub & jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq -R --slurp '{query: ., variables: {input: $ARGS.named}}' \ | |
--arg name "hello-world" \ | |
--arg visibility "PRIVATE" \ | |
--arg ownerId "<ORG-NODEID>" \ | |
--arg teamId "<TEAM-NODEID>" \ | |
<<<' | |
mutation ($input: CreateRepositoryInput!) { | |
createRepository(input: $input) { | |
repository { | |
nameWithOwner | |
} | |
} | |
}' | hub api -it graphql --input - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment