graphql-decoder
v1.0.1
Published
A utility for decoding a URL GraphQL request to its formatted constituent parts.
Downloads
2
Readme
GraphQL URL Decoder
Installation
npm i graphql-decoder
Usage
This project is used for extracting and formatting a GraphQL query from a full request URL.
For example:
Input:
npx graphql-decoder https://example.com/%7B%20test%20%7B%20example%20%7D%20%7D/more-stuff
Output:
{
test {
example
}
}
Command line arguments
By specifying a relative file path with the --outputFile
named argument, the formatted GraphQL query can be saved to a file, e.g.
npx graphql-decoder https://example.com/%7B%20test%20%7B%20example%20%7D%20%7D/more-stuff --outputFile query.graphql