Crates.io | graphquery |
lib.rs | graphquery |
version | 0.3.0 |
source | src |
created_at | 2023-03-27 03:51:53.751475 |
updated_at | 2023-04-25 15:26:29.861206 |
description | A simple cli tool to make graphql request. |
homepage | |
repository | https://github.com/jrdeng/graphquery |
max_upload_size | |
id | 821657 |
size | 42,388 |
A simple cli tool to make graphql request to specified server.
Command and options:
Usage: graphquery.exe [OPTIONS] --url <API_URL> --token <TOKEN>
Options:
-u, --url <API_URL> URL of GraphQL API. for example: https://<your-server.com>/api/graphql
-t, --token <TOKEN> Token to access the API
-f, --file <QUERY_FILE> File that contains the query string. one of '-f' and '-q' must be set
-q, --query <API_URL> Query string. '-f' will be omitted if this is set
-o, --output <OUTPUT_FILE> Output file to store the query result. The result is echo to std out by default
-h, --help Print help
cargo run -- --url=https://api.github.com/graphql --token=${YOUR_TOKEN} --query="query{viewer {login}}"
cargo run -- --url=https://api.github.com/graphql --token=${YOUR_TOKEN} --file=graphql/github_issues.graphql --output=output.json
cargo run -- --url=https://api.github.com/graphql --token=${YOUR_TOKEN} --file=graphql/github_issues_with_x.graphql --extra owner=jrdeng --extra name=Playground
The "--extra" arguments will be used to replace some varialbe defined in the query string. (in the form: "$x:key
". please check the example query file in the above example for details.)