0.2.1 • Published 3 years ago

curl2gql v0.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Why made this

There are too many tools as converting graphql request to curl for debug, but sometimes I only need to make cUrl more readability.

Usage

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
  }
}
0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago