# graphql-resolvers

> Resolver composition library for GraphQL.

Latest version **0.4.2** (published 2020-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-resolvers
pnpm add graphql-resolvers
yarn add graphql-resolvers
bun add graphql-resolvers
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2020-02-04 |
| First published | 2017-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/graphql-resolvers) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 112.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 278 |
| Author | Lucas Constantino Silva |
| Maintainers | lucasconstantino |
| Keywords | apollo, composition, functional, graphql, resolver |

## Links

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

## Dependencies (3)

- [deep-equal](https://npm.io/package/deep-equal.md) ^2.0.1
- [object-path](https://npm.io/package/object-path.md) ^0.11.4
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.8.4

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.4.2 (latest) — 2020-02-04
- 0.3.2 (beta) — 2018-03-20
- 0.3.3 — 2019-04-30
- 0.2.2 — 2018-02-13
- 0.2.1 — 2018-02-03
- 0.2.0 — 2017-05-08
- 0.1.1 — 2017-05-07
- 0.1.0 — 2017-05-07
- 0.0.2 — 2017-04-09
- 0.0.1 — 2017-04-09

## README

# GraphQL Resolvers

Resolver composition library for GraphQL

[![build status](https://img.shields.io/travis/lucasconstantino/graphql-resolvers/master.svg?style=flat-square)](https://travis-ci.org/lucasconstantino/graphql-resolvers)
[![coverage](https://img.shields.io/codecov/c/github/lucasconstantino/graphql-resolvers.svg?style=flat-square)](https://codecov.io/github/lucasconstantino/graphql-resolvers)
[![npm version](https://img.shields.io/npm/v/graphql-resolvers.svg?style=flat-square)](https://www.npmjs.com/package/graphql-resolvers)
[![sponsored by Taller](https://raw.githubusercontent.com/TallerWebSolutions/tallerwebsolutions.github.io/master/sponsored-by-taller.png)](https://taller.net.br/en/)

---

This library consists of simple *[but well tested](https://codecov.io/github/lucasconstantino/graphql-resolvers)* helper functions for combining other functions into more specialized ones.

## Installation

This package is available on [npm](https://www.npmjs.com/package/graphql-resolvers) as: *graphql-resolvers*

```
npm install graphql-resolvers
```

> You should consider using [yarn](https://yarnpkg.com/), though.

## Motivation

Many times we end-up repeating lots of logic on our resolvers. Access control, for instance, is something that can be done in the resolver level but just tends to end up with repeated code, even when creating services for such a task. This package aims to make it easier to build smart resolvers with logic being reusable and split in small pieces. Think *[recompose](https://github.com/acdlite/recompose)*, but for GraphQL resolvers.

## Documentation

[Read full documentation here](docs/API.md)

## Similar projects

Besides being inspired by some functional libraries out there, this project has some goals in common with other projects:

#### [apollo-resolvers](https://github.com/thebigredgeek/apollo-resolvers):

While `graphql-resolvers` follows the functional paradigm, `apollo-resolvers` project solves some problems using an opinionated and OOP approach. Furthermore, the second also solves other problems which `graphql-resolvers` does not intend to work on, such as [solving circular references on the resolver's context](https://github.com/thebigredgeek/apollo-resolvers#resolver-context).

#### [graphql-tools](https://github.com/apollographql/graphql-tools)

At first, my idea was to [incorporate](https://github.com/apollographql/graphql-tools/issues/307) the `combineResolvers` method into the wider project `graphql-tools`. That may yet happen some day, but I think people my not want to install the whole `graphql-tools` project when wanting this simple package's helper on their projects. Also, `combineResolvers` should work pretty fine with resolvers binded into [`graphql/types`](http://graphql.org/graphql-js/type/) too.

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