Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use gq with mutation and json input file #56

Open
kad-meedel opened this issue Dec 18, 2019 · 1 comment
Open

How to use gq with mutation and json input file #56

kad-meedel opened this issue Dec 18, 2019 · 1 comment

Comments

@kad-meedel
Copy link

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.

@Motoxpro
Copy link

Motoxpro commented Jul 7, 2021

Need to use double quotes instead of single

variableFile='./repodata' should be variableFile="./repodata"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants