# @pequehq/graphql

> Peque GraphQL

Latest version **1.0.6** (published 2022-02-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @pequehq/graphql
pnpm add @pequehq/graphql
yarn add @pequehq/graphql
bun add @pequehq/graphql
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2022-02-17 |
| First published | 2022-02-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 4 |
| Unpacked size | 209.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Simone Di Cicco |
| Maintainers | alesmit, simonedicicco |

## Links

- npm: https://www.npmjs.com/package/@pequehq/graphql
- npm.io page: https://npm.io/package/@pequehq/graphql

## Dependencies (4)

- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@graphql-tools/merge](https://npm.io/package/@graphql-tools/merge.md) ^8.2.2
- [@graphql-tools/utils](https://npm.io/package/@graphql-tools/utils.md) ^8.6.1
- [@graphql-tools/schema](https://npm.io/package/@graphql-tools/schema.md) ^8.3.1

## Recent versions

- 1.0.6 (latest) — 2022-02-17
- 1.0.5 — 2022-02-17
- 1.0.4 — 2022-02-17
- 1.0.3 — 2022-02-14
- 1.0.2 — 2022-02-14
- 1.0.1 — 2022-02-13
- 1.0.0 — 2022-02-13

## README

# Peque GraphQL

[![CI](https://github.com/pequehq/graphql/actions/workflows/ci.yml/badge.svg)](https://github.com/pequehq/graphql/actions/workflows/ci.yml)
![coverage](https://github.com/peque-ts/graphql/raw/main/coverage-badge.svg)

Peque GraphQL is an OOP transposition for Apollo Server Resolver.

## Install

```shell
npm install @pequehq/graphql reflect-metadata
```

**Note**: tsconfig's `compilerOptions` must have both `experimentalDecorators` and `emitDecoratorMetadata` set to **true**.

## Example

```typescript
import { Resolver, ResolverService } from '@pequehq/graphql';

@Resolver()
class ResolverExample {
  @Query()
  countries(@Args('continent') continent: string): unknown {
    return [
      { id: 1, name: 'italy', continent: 'europe' },
      { id: 2, name: 'spain', continent: 'europe' },
      { id: 3, name: 'china', continent: 'asia' },
    ].filter((country) => country.continent === continent);
  }
}

const resolverService = new ResolverService();

const resolvers = resolverService.get([new ResolverExample()]);

// Add resolvers to your Apollo Server integration.
```

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