graphqurl
graphqurl copied to clipboard
How to use gq with mutation and json input file
Hello, I found the gq very usefull, but I'm stil looking for the right syntax how to implement a gq with a mutation and a json input file for the variables.
mutation looks like this:
queryFile:
mutation createRepository($input: CreateRepositoryInput!) { createRepository(input: $input) { clientMutationId } }
variableFile:
{
"input": {
"name" : "create-testrepo",
"visibility": "INTERNAL",
"description": "create test repository",
"ownerId": "xxxxxxxxxxxxxxxxxxxxx",
"teamId": "xxxxxxxxxxxxxxxxxx",
"hasIssuesEnabled": false,
"hasWikiEnabled": false
}
}
When I use this on the command line I get an error.
gq https://api.github.com/graphql -H "authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "content-type: application/json" --variableFile='./repodata' --queryFile='./query.gql
» Error: cannot parse header '--variableFile='./repodata'' (multiple ':')
Please advice how to use.
Need to use double quotes instead of single
variableFile='./repodata'
should be variableFile="./repodata"