There are too many tools as converting graphql request to curl for debug, but sometimes I only need to make cUrl more readability.
Try by npx:
npx curl2gql curl 'http://localhost:3000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:3000' -H 'Authorization: Bearer XXX' --data-binary '{"query":"query {\n article(id: 2){\n title\n subTitle\n }\n}","variables":{"query":{"pageSize":10,"pageNumber":1}}}' --compressed
Then you will get:
QUERY:
query {
article(id: 2) {
title
subTitle
}
}
HEADER:
{
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/json",
"Accept": "application/json",
"Connection": "keep-alive",
"DNT": "1",
"Origin": "http://localhost:3000",
"Authorization": "Bearer XXX"
}
VARIABLES:
{
"query": {
"pageSize": 10,
"pageNumber": 1
}
}