Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created November 4, 2022 05:51
Show Gist options
  • Save kyanny/7af5df8710001b97c192ddd55deac098 to your computer and use it in GitHub Desktop.
Save kyanny/7af5df8710001b97c192ddd55deac098 to your computer and use it in GitHub Desktop.
# Usage: gq query.txt
gq() {
if [ ! -f $1 ]; then
echo "ERROR: No such file $1"
return
fi
local query=$(cat $1)
bash -xc "$(printf "gh api graphql -f query='%s'" "$query")"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment