Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/graphql-in-depth/graphcurl

GraphQL curl-like command-line client
https://github.com/graphql-in-depth/graphcurl

apollo apollo-client cli command command-line console csv csv-import curl graphql graphql-client graphql-import graphql-import-cli import json winston yaml

Last synced: 4 days ago
JSON representation

GraphQL curl-like command-line client

Awesome Lists containing this project

README

        

# Graphcurl

GraphQL curl-like command-line client

[![Version](https://img.shields.io/npm/v/graphcurl.svg)](https://npmjs.org/package/graphcurl)
[![Downloads/week](https://img.shields.io/npm/dw/graphcurl.svg)](https://npmjs.org/package/graphcurl)
[![License](https://img.shields.io/npm/l/graphcurl.svg)](https://github.com/graphql-in-depth/graphcurl/blob/master/LICENSE)

## Getting Started

### Install

You need [Node.js](https://nodejs.org/en/download/) and optionally [Yarn](https://yarnpkg.com/en/docs/install).

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 graphql endpoint
-k, --key output only selected key from response data
-o, --output write response data to json file instead of stdout
-q, --query graphql query (or mutation), may use #import
-d, --data query variables, file may be json or yaml (default: [])
-H, --header 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

- [x] 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](https://graphql-config.com), [Prisma config extension](https://github.com/prisma-labs/graphql-config-extension-prisma), and [Apollo config](https://www.apollographql.com/docs/references/apollo-config/)
- [ ] Use default paths for graphql files from extended GraphQL Config
- [ ] Cleanup code
- [ ] Rewrite to TypeScript

## Development

### Code Style

Install [Prettier](https://github.com/prettier/prettier#editor-integration) support for used editor/IDE.