Skip to content

Instantly share code, notes, and snippets.

@mislav
Created April 15, 2020 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mislav/0a8b250bb9420ebe3ca5a896a6f56f5e to your computer and use it in GitHub Desktop.
Save mislav/0a8b250bb9420ebe3ca5a896a6f56f5e to your computer and use it in GitHub Desktop.
GraphQL mutation example with hub & jq
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