This package has been deprecated

Author message:

security

curl2gql

0.2.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i curl2gql

Weekly Downloads

1

Version

0.2.1

License

ISC

Unpacked Size

6.42 kB

Total Files

7

Last publish

Collaborators

  • npm