I'm trying to do a GraphQL query to GitHub v4 API in a JS app but I'm having a "Problem with JSON" error. So I'm trying to do it with cURL but it seems to have a problem I can't see.
curl -H "Authorization: token bearer" -H "Content-Type:application/json" -X POST -d '{ "query": "query {
viewer {
watching(first: 3, orderBy: {field: UPDATED_AT, direction: DESC}) {
nodes {
refs(refPrefix: \"refs/heads/\", orderBy: {direction: DESC, field: TAG_COMMIT_DATE}, last: 100) {
nodes {
target {
... on Commit {
history(first: 10) {
...CommitFragment
}
}
}
}
}
}
}
}
rateLimit {
limit
cost
remaining
resetAt
}
}
fragment CommitFragment on CommitHistoryConnection {
nodes {
message
author {
name
avatarUrl(size: 30)
}
}
}
I want to mention that the request is working on the github.com/v4/explorer/ website. And I have escaped the quotes...