# @ryanccn/gql

> A tiny GraphQL querying library

Latest version **2.1.0** (published 2025-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ryanccn/gql
pnpm add @ryanccn/gql
yarn add @ryanccn/gql
bun add @ryanccn/gql
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities; has provenance.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2025-04-06 |
| First published | 2024-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Ryan Cao |
| Maintainers | ryanccn |
| Keywords | graphql, fetch, api |

## Links

- npm: https://www.npmjs.com/package/@ryanccn/gql
- Repository: https://github.com/ryanccn/gql
- Homepage: https://github.com/ryanccn/gql#readme
- Issues: https://github.com/ryanccn/gql/issues
- npm.io page: https://npm.io/package/@ryanccn/gql

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2025-04-06
- 2.0.0 — 2024-02-17

## README

# @ryanccn/gql

A tiny GraphQL querying library.

## Installation

```console
$ npm install @ryanccn/gql
$ yarn add @ryanccn/gql
$ pnpm add @ryanccn/gql
```

## Usage

```typescript
import { createGql } from "@ryanccn/gql";

const gql = createGql("https://countries.trevorblades.com/");

const { success, data } = await gql`
	query {
		continents {
			name
		}
	}
`();
```

If your GraphQL client is named something else, you can also do

```typescript
import { createGql } from "@ryanccn/gql";

const gqlClient = createGql("https://countries.trevorblades.com/");

const { success, data } = await gqlClient.gql`
	query {
		continents {
			name
		}
	}
`();
```

to retain the DX benefits of the `gql` tag.

## License

MIT

---
_Source: https://npm.io/package/@ryanccn/gql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
