19 个稳定版本
3.7.3 | 2024 年 6 月 4 日 |
---|---|
3.7.2 | 2024 年 5 月 22 日 |
3.7.0 | 2024 年 4 月 28 日 |
3.5.0 | 2024 年 3 月 25 日 |
3.2.2 | 2023 年 6 月 26 日 |
#175 in HTTP 服务器
96 每月下载量
385KB
8K SLoC
概述
Cynic 是一个 Rust 的代码优先 GraphQL 客户端。 cynic-cli
是一个 CLI,它为与 cynic
的特定操作以及 GraphQL 的一般操作提供实用程序。
特性
- 可以检查远程服务器并导出其模式。
- 智能功能检测以进行检查 - 检查服务器支持哪些功能,仅针对这些功能进行检查。
用法
$ cynic help
A CLI for cynic, a code first GraphQL client for Rust
Usage: cynic [COMMAND]
Commands:
introspect Runs an introspection query against a GraphQL server and outputs the servers schema
querygen Runs querygen that allows you to generate Rust code from a schema and for a query
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
检查
introspect
命令在服务器上运行检查查询,并将模式打印到 stdout/文件。
$ cynic help introspect
Runs an introspection query against a GraphQL server and outputs the servers schema
Usage: cynic introspect [OPTIONS] <URL>
Arguments:
<URL>
The URL of the GraphQL schema that we should introspect
Options:
-H, --header <HEADERS>
Any headers to send with the introspection request
These should be in HTTP format e.g. `-H "Authorization: Bearer a_token_123"`
-o, --output <OUTPUT>
The name of a file we should output the schema into.
By default we print to stdout.
--server-version <SERVER_VERSION>
The version of the GraphQL specificaiton that the remote GraphQL server implements
Different versions of GraphQL expose different fields via introspection, so we need to know which set of fields to ask for.
By default we run an additional query to figure out what the server we're talking to supports.
[default: auto]
Possible values:
- 2018: Run an introspection query compatible with the 2018 GraphQL specification
- 2021: Run an introspection query compatible with the 2021 GraphQL specification
- auto: Run an additional query to determine what the GraphQL server supports
-h, --help
Print help (see a summary with '-h')
依赖项
~11–22MB
~331K SLoC