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 服务器

Download history 139/week @ 2024-04-24 38/week @ 2024-05-01 89/week @ 2024-05-08 60/week @ 2024-05-15 121/week @ 2024-05-22 106/week @ 2024-05-29 69/week @ 2024-06-05 28/week @ 2024-06-12 8/week @ 2024-06-19 10/week @ 2024-06-26 113/week @ 2024-07-03 7/week @ 2024-07-10 10/week @ 2024-07-17 29/week @ 2024-07-24 36/week @ 2024-07-31 21/week @ 2024-08-07

96 每月下载量

MPL-2.0 许可证

385KB
8K SLoC

cynic-cli

A CLI for Cynic, the code first GraphQL client for Rust

Crate Info API Docs Discord Chat

文档 | 变更日志

概述

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