22 stable releases

new 3.9.1 Dec 3, 2024
3.9.0 Nov 12, 2024
3.8.0 Aug 29, 2024
3.7.3 Jun 4, 2024
3.2.2 Jun 26, 2023

#318 in HTTP server

Download history 95/week @ 2024-08-23 58/week @ 2024-08-30 13/week @ 2024-09-06 5/week @ 2024-09-13 24/week @ 2024-09-20 20/week @ 2024-09-27 13/week @ 2024-10-04 5/week @ 2024-10-11 10/week @ 2024-10-18 9/week @ 2024-10-25 22/week @ 2024-11-01 133/week @ 2024-11-08 34/week @ 2024-11-15 12/week @ 2024-11-22 132/week @ 2024-11-29

314 downloads per month

MPL-2.0 license

395KB
8K SLoC

cynic-cli

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

Crate Info API Docs Discord Chat

Documentation | Changelog

Overview

Cynic is a code first GraphQL client for Rust. cynic-cli is a CLI that provides utilities for working with cynic specifically and GraphQL in general.

Features

  • Can introspect a remote server and dump it's schema.
  • Intelligent feature detection for introspection - checks which features a server supports and only introspects for those.

Usage

$ 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

The introspect command runs an introspection query against a server and prints the schema to stdout/a file.

$ 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')

Dependencies

~11–26MB
~324K SLoC