graphcurl

GraphQL curl-like command-line client


Keywords
graphql, graphql-client, graphql-import, graphql-import-cli, cli, curl, client, import, json, yaml, csv, csv-import, console, command, command-line, apollo, apollo-client, winston
License
MIT
Install
npm install graphcurl@0.3.1

Documentation

Graphcurl

GraphQL curl-like command-line client

Version Downloads/week License

Getting Started

Install

You need Node.js and optionally Yarn.

You can install graphcurl:

yarn global add graphcurl
# or: npm install -g graphcurl

Or you can run it without installing:

npx graphcurl

Usage

Usage: gc|graphcurl [options]

Options:
  -V, --version                        output the version number
  -e, --endpoint <url>                 graphql endpoint
  -k, --key <key>                      output only selected key from response data
  -o, --output <file>                  write response data to json file instead of stdout
  -q, --query <query|@file|->          graphql query (or mutation), may use #import
  -d, --data <variable:value|@file|->  query variables, file may be json or yaml (default: [])
  -H, --header <header:value|@file|->  custom headers, file may be json or yaml (default: [])
  -v, --verbose                        output more details
  -D, --debug                          output debug data
  -h, --help                           output usage information

Roadmap

  • Implement working prototype
  • Support automatic/whitelisted persisted queries
  • Select operation from a file that contains multiple queries/mutations
  • Send multiplied operation in single request for array json/yaml data
  • Load array data from csv with header
  • Select default/environment endpoints from GraphQL Config, Prisma config extension, and Apollo config
  • Use default paths for graphql files from extended GraphQL Config
  • Cleanup code
  • Rewrite to TypeScript

Development

Code Style

Install Prettier support for used editor/IDE.