The following GraphQL query runs perfectly fine in Github GraphQL Explorer:
$ cat GraphQL_query.graphql
query {
__schema {
types {
name
kind
description
fields {
name
}
}
}
}
however, when I send it via curl
:
curl -H "Authorization: bearer token" -X POST -d "`cat GraphQL_query.graphql`" https://api.github.com/graphql
I'll get:
{
"message": "Problems parsing JSON",
"documentation_url": "https://developer.github.com/v4"
}
What's wrong? How can I make it works? Thx.