14 breaking releases

new 0.16.0 Jan 15, 2026
0.15.0 Dec 8, 2025
0.14.0 Mar 26, 2024
0.13.0 May 30, 2023
0.2.0 Jul 22, 2018

#207 in HTTP server

Download history 3082/week @ 2025-09-25 2577/week @ 2025-10-02 2245/week @ 2025-10-09 2048/week @ 2025-10-16 1768/week @ 2025-10-23 1595/week @ 2025-10-30 1297/week @ 2025-11-06 2764/week @ 2025-11-13 3792/week @ 2025-11-20 2986/week @ 2025-11-27 1912/week @ 2025-12-04 1547/week @ 2025-12-11 1156/week @ 2025-12-18 1004/week @ 2025-12-25 933/week @ 2026-01-01 927/week @ 2026-01-08

4,219 downloads per month

Apache-2.0 OR MIT

475KB
12K SLoC

GraphQL 7K SLoC // 0.0% comments Rust 5K SLoC // 0.0% comments

GraphQL client CLI

This is still a WIP, the main use for it now is to download the schema.json from a GraphQL endpoint, which you can also do with the Apollo CLI.

Install

cargo install graphql_client_cli --force

introspect schema

Get the schema from a live GraphQL API. The schema is printed to stdout.

USAGE:
    graphql-client introspect-schema [FLAGS] [OPTIONS] <schema_location>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
        --no-ssl     Set this option to disable ssl certificate verification. Default value is false.
                     ssl verification is turned on by default.

OPTIONS:
        --authorization <authorization>    Set the contents of the Authorization header.
        --header <headers>...              Specify custom headers. --header 'X-Name: Value'
        --output <output>                  Where to write the JSON for the introspected schema.

ARGS:
    <schema_location>    The URL of a GraphQL endpoint to introspect.

generate client code

USAGE:
    graphql-client generate [FLAGS] [OPTIONS] <query_path> --schema-path <schema_path>

FLAGS:
    -h, --help             Prints help information
        --no-formatting    If you don't want to execute rustfmt to generated code, set this option. Default value is
                           false.
    -V, --version          Prints version information

OPTIONS:
    -I, --variables-derives <variables_derives>
            Additional derives that will be added to the generated structs and enums for the variables.
            --variables-derives='Serialize,PartialEq'
    -O, --response-derives <response_derives>
            Additional derives that will be added to the generated structs and enums for the response.
            --response-derives='Serialize,PartialEq'            
    -d, --deprecation-strategy <deprecation_strategy>
            You can choose deprecation strategy from allow, deny, or warn. Default value is warn.

    -m, --module-visibility <module_visibility>
            You can choose module and target struct visibility from pub and private. Default value is pub.

    -o, --output-directory <output_directory>            The directory in which the code will be generated
    -s, --schema-path <schema_path>                      Path to GraphQL schema file (.json or .graphql).
    -o, --selected-operation <selected_operation>
            Name of target query. If you don't set this parameter, cli generate all queries in query file.
	--fragments-other-variant
            Generate an Unknown variant for enums generated by fragments.


ARGS:
    <query_path>    Path to the GraphQL query file.

If you want to use formatting feature, you should install like this.

cargo install graphql_client_cli

Dependencies

~9–25MB
~297K SLoC