# graphql-client-rxjs

> Simple GraphQL Client using fetch and rxjs.

Latest version **0.0.5** (published 2018-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-client-rxjs
pnpm add graphql-client-rxjs
yarn add graphql-client-rxjs
bun add graphql-client-rxjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2018-03-07 |
| First published | 2018-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Felipe Berton |
| Maintainers | fefb |

## Links

- npm: https://www.npmjs.com/package/graphql-client-rxjs
- Repository: https://github.com/FeFB/graphql-client-rxjs
- Homepage: https://github.com/FeFB/graphql-client-rxjs#readme
- Issues: https://github.com/FeFB/graphql-client-rxjs/issues
- npm.io page: https://npm.io/package/graphql-client-rxjs

## Dependencies (3)

- [rxjs](https://npm.io/package/rxjs.md) ^5.5.6
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.0.0
- [graphql-obj2arg](https://npm.io/package/graphql-obj2arg.md) ^0.1.0

## Recent versions

- 0.0.5 (latest) — 2018-03-07
- 0.0.4 — 2018-02-27
- 0.0.3 — 2018-02-27
- 0.0.1 — 2018-02-27

## README

# graphql-client-rxjs

Simple GraphQL Client using http fetch and RxJS

## Install

```
npm i graphql-client-rxjs --save
```

## Usage

Note: gc.query(query) is using method GET

```
const GraphQLClient = require("graphql-client-rxjs");
const gc = new GraphQLClient("http://domain.com/graphql");

const query = `
{
  adm(id: "Vovz66F9dJ95gTR2lExk") {
    id
  }
}
`;

gc.query(query)
  .subscribe(body=> console.log(body), err => console.log(err));
```

```
gc.mutation(mutationQuery)
  .subscribe(body=> console.log(body), err => console.log(err));
```

Alternative for simples queries and mutations

```
gc.get(queryName, params, fields).subscribe(body=>console.log(body), err => console.log(err));

gc.set(queryName, params, fields).subscribe(body=>console.log(body), err => console.log(err));
```

Example:

```
gc
  .get("adm", { id: "Vovz66F9dJ95gTR2lExk" }, "id, name, address{street}")
  .subscribe(sucess, erro);

//it's like
const query = `
{
  adm(id: "Vovz66F9dJ95gTR2lExk") {
    id,
    name,
    address {
      street
    }
  }
}
`;

gc.query(query)
  .subscribe(body=> console.log(body), err => console.log(err));
```

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