{"id":19133751,"url":"https://github.com/chazmcgarvey/graphql-client","last_synced_at":"2026-04-15T21:31:00.675Z","repository":{"id":42638580,"uuid":"247573503","full_name":"chazmcgarvey/graphql-client","owner":"chazmcgarvey","description":"A GraphQL client","archived":false,"fork":false,"pushed_at":"2022-03-30T01:40:50.000Z","size":239,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T21:10:44.230Z","etag":null,"topics":["graphql","perl"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/graphql","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chazmcgarvey.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-16T00:03:46.000Z","updated_at":"2022-03-30T01:34:24.000Z","dependencies_parsed_at":"2022-08-29T11:10:45.605Z","dependency_job_id":null,"html_url":"https://github.com/chazmcgarvey/graphql-client","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/chazmcgarvey/graphql-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fgraphql-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fgraphql-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fgraphql-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fgraphql-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chazmcgarvey","download_url":"https://codeload.github.com/chazmcgarvey/graphql-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chazmcgarvey%2Fgraphql-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31861236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","perl"],"created_at":"2024-11-09T06:23:42.753Z","updated_at":"2026-04-15T21:31:00.659Z","avatar_url":"https://github.com/chazmcgarvey.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\ngraphql - Command-line GraphQL client\n\n# VERSION\n\nversion 0.605\n\n# SYNOPSIS\n\n    graphql \u003cURL\u003e \u003cQUERY\u003e [ [--variables JSON] | [--variable KEY=VALUE]... ]\n            [--operation-name NAME] [--transport KEY=VALUE]...\n            [--[no-]unpack] [--filter JSONPATH]\n            [--format json|json:pretty|yaml|perl|csv|tsv|table] [--output FILE]\n\n    graphql --version|--help|--manual\n\n# DESCRIPTION\n\n`graphql` is a command-line program for executing queries and mutations on\na [GraphQL](https://graphql.org/) server.\n\n# INSTALL\n\nThere are several ways to install `graphql` to your system.\n\n## from CPAN\n\nYou can install `graphql` using [cpanm](https://metacpan.org/pod/cpanm):\n\n    cpanm GraphQL::Client\n\n## from GitHub\n\nYou can also choose to download `graphql` as a self-contained executable:\n\n    curl -OL https://raw.githubusercontent.com/chazmcgarvey/graphql-client/solo/graphql\n    chmod +x graphql\n\nTo hack on the code, clone the repo instead:\n\n    git clone https://github.com/chazmcgarvey/graphql-client.git\n    cd graphql-client\n    make bootstrap      # installs dependencies; requires cpanm\n\n# OPTIONS\n\n## `--url URL`\n\nThe URL of the GraphQL server endpoint.\n\nIf no `--url` option is given, the first argument is assumed to be the URL.\n\nThis option is required.\n\nAlias: `-u`\n\n## `--query STR`\n\nThe query or mutation to execute.\n\nIf no `--query` option is given, the next argument (after URL) is assumed to be the query.\n\nIf the value is \"-\" (which is the default), the query will be read from `STDIN`.\n\nSee: [https://graphql.org/learn/queries/](https://graphql.org/learn/queries/)\n\nAlias: `--mutation`\n\n## `--variables JSON`\n\nProvide the variables as a JSON object.\n\nAliases: `--vars`, `-V`\n\n## `--variable KEY=VALUE`\n\nAn alternative way to provide variables one at a time. This option can be repeated to provide\nmultiple variables.\n\nIf used in combination with [\"--variables JSON\"](#variables-json), this option is silently ignored.\n\nSee: [https://graphql.org/learn/queries/#variables](https://graphql.org/learn/queries/#variables)\n\nAliases: `--var`, `-d`\n\n## `--operation-name NAME`\n\nInform the server which query/mutation to execute.\n\nAlias: `-n`\n\n## `--output FILE`\n\nWrite the response to a file instead of STDOUT.\n\nAlias: `-o`\n\n## `--transport KEY=VALUE`\n\nKey-value pairs for configuring the transport (usually HTTP).\n\nAlias: `-t`\n\n## `--format STR`\n\nSpecify the output format to use. See [\"FORMAT\"](#format).\n\nAlias: `-f`\n\n## `--unpack`\n\nEnables unpack mode.\n\nBy default, the response structure is printed as-is from the server, and the program exits 0.\n\nWhen unpack mode is enabled, if the response completes with no errors, only the data section of\nthe response is printed and the program exits 0. If the response has errors, the whole response\nstructure is printed as-is and the program exits 1. See [\"EXAMPLES\"](#examples) to see what this looks like in\npractice.\n\nUse `--no-unpack` to disable if unpack mode was enabled via `GRAPHQL_CLIENT_OPTIONS`.\n\n## `--filter JSONPATH`\n\nFilter the response based on a [JSONPath](https://metacpan.org/pod/JSON%3A%3APath#SYNOPSIS) expression.\n\nRequires [JSON::Path](https://metacpan.org/pod/JSON%3A%3APath).\n\nAlias: `-p`\n\n# FORMAT\n\nThe argument for [\"--format STR\"](#format-str) can be one of:\n\n- `csv` - Comma-separated values (requires [Text::CSV](https://metacpan.org/pod/Text%3A%3ACSV))\n- `json:pretty` - Human-readable JSON (default)\n- `json` - JSON\n- `perl` - Perl code (requires [Data::Dumper](https://metacpan.org/pod/Data%3A%3ADumper))\n- `table` - Table (requires [Text::Table::Any](https://metacpan.org/pod/Text%3A%3ATable%3A%3AAny))\n- `tsv` - Tab-separated values (requires [Text::CSV](https://metacpan.org/pod/Text%3A%3ACSV))\n- `yaml` - YAML (requires [YAML](https://metacpan.org/pod/YAML))\n\nThe `csv`, `tsv`, and `table` formats will only work if the response has a particular shape:\n\n    {\n        \"data\" : {\n            \"onefield\" : [\n                {\n                    \"key\" : \"value\",\n                    ...\n                },\n                ...\n            ]\n        }\n    }\n\nor\n\n    {\n        \"data\" : {\n            \"onefield\" : [\n                \"value\",\n                ...\n            ]\n        }\n    }\n\nIf the response cannot be formatted, the default format will be used instead, an error message will\nbe printed to STDERR, and the program will exit 3.\n\nTable formatting can be done by one of several different modules, each with its own features and\nbugs. The default module is [Text::Table::Tiny](https://metacpan.org/pod/Text%3A%3ATable%3A%3ATiny), but this can be overridden using the\n`PERL_TEXT_TABLE` environment variable if desired, like this:\n\n    PERL_TEXT_TABLE=Text::Table::HTML graphql ... -f table\n\nThe list of supported modules is at [\"@BACKENDS\" in Text::Table::Any](https://metacpan.org/pod/Text%3A%3ATable%3A%3AAny#BACKENDS).\n\n# EXAMPLES\n\nDifferent ways to provide the query/mutation to execute:\n\n    graphql http://myserver/graphql {hello}\n\n    echo {hello} | graphql http://myserver/graphql\n\n    graphql http://myserver/graphql \u003c\u003cEND\n    \u003e {hello}\n    \u003e END\n\n    graphql http://myserver/graphql\n    Interactive mode engaged! Waiting for a query on \u003cSTDIN\u003e...\n    {hello}\n    ^D\n\nExecute a query with variables:\n\n    graphql http://myserver/graphql \u003c\u003cEND --var episode=JEDI\n    \u003e query HeroNameAndFriends($episode: Episode) {\n    \u003e   hero(episode: $episode) {\n    \u003e     name\n    \u003e     friends {\n    \u003e       name\n    \u003e     }\n    \u003e   }\n    \u003e }\n    \u003e END\n\n    graphql http://myserver/graphql --vars '{\"episode\":\"JEDI\"}'\n\nConfigure the transport:\n\n    graphql http://myserver/graphql {hello} -t headers.authorization='Basic s3cr3t'\n\nThis example shows the effect of [\"--unpack\"](#unpack):\n\n    graphql http://myserver/graphql {hello}\n\n    # Output:\n    {\n        \"data\" : {\n            \"hello\" : \"Hello world!\"\n        }\n    }\n\n    graphql http://myserver/graphql {hello} --unpack\n\n    # Output:\n    {\n        \"hello\" : \"Hello world!\"\n    }\n\n# ENVIRONMENT\n\nSome environment variables affect the way `graphql` behaves:\n\n- `GRAPHQL_CLIENT_DEBUG` - Set to 1 to print diagnostic messages to STDERR.\n- `GRAPHQL_CLIENT_HTTP_USER_AGENT` - Set the HTTP user agent string.\n- `GRAPHQL_CLIENT_OPTIONS` - Set the default set of options.\n- `PERL_TEXT_TABLE` - Set table format backend; see [\"FORMAT\"](#format).\n\n# EXIT STATUS\n\nHere is a consolidated summary of what exit statuses mean:\n\n- `0` - Success\n- `1` - Client or server errors\n- `2` - Option usage is wrong\n- `3` - Could not format the response as requested\n\n# SEE ALSO\n\n- [GraphQL::Client](https://metacpan.org/pod/GraphQL%3A%3AClient) - Programmatic interface\n\n# BUGS\n\nPlease report any bugs or feature requests on the bugtracker website\n[https://github.com/chazmcgarvey/graphql-client/issues](https://github.com/chazmcgarvey/graphql-client/issues)\n\nWhen submitting a bug or request, please include a test-file or a\npatch to an existing test-file that illustrates the bug or desired\nfeature.\n\n# AUTHOR\n\nCharles McGarvey \u003cccm@cpan.org\u003e\n\n# CONTRIBUTOR\n\njwright \u003cjwright@ecstuning.com\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2020 by Charles McGarvey.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchazmcgarvey%2Fgraphql-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchazmcgarvey%2Fgraphql-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchazmcgarvey%2Fgraphql-client/lists"}