• Stars
    star
    282
  • Rank 146,549 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔌 Resolver composition library for GraphQL.

GraphQL Resolvers

Resolver composition library for GraphQL

build status coverage npm version sponsored by Taller


This library consists of simple but well tested helper functions for combining other functions into more specialized ones.

Installation

This package is available on npm as: graphql-resolvers

npm install graphql-resolvers

You should consider using yarn, 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, but for GraphQL resolvers.

Documentation

Read full documentation here

Similar projects

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

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.

graphql-tools

At first, my idea was to incorporate 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 too.

More Repositories

1

react-policies

Decoupled and unopinionated policy system for React components
JavaScript
74
star
2

apollo-cache-invalidation

Experimental cache invalidation tools for Apollo.
JavaScript
66
star
3

graphiql-online

Online GraphiQL instance with a configurable endpoint!
JavaScript
62
star
4

SassySkeleton

A boilerplate for better structured styles based on Sass & Compass.
CSS
54
star
5

graphql-modules

⚠️ [DEPRECATED] GraphQL module library for Apollo.
JavaScript
51
star
6

now-we-test

Test your Now deployed Node.js lambdas locally
JavaScript
50
star
7

now-micro

The missing Micro builder for Now 2.0
JavaScript
45
star
8

react-compose-hooks

React Hooks composition library.
JavaScript
43
star
9

graphql-apq

🎯 Automatic persisted queries (APQ) for any GraphQL server.
TypeScript
43
star
10

next-cache-tags

Active ISR revalidation based on surrogate keys for Next.js
TypeScript
38
star
11

react-inspect-props

React properties inspector with the power of Redux DevTools
32
star
12

graphql-apollo-rest-wrap

Reference code base for the "GraphQL today using Apollo for applications that still depend on REST APIs" post.
JavaScript
31
star
13

react-compose-events

A Higher-Order Component factory to attach outside event listeners
24
star
14

redux-transient

Transient reducers for Redux
JavaScript
23
star
15

react-data-loader

Dead simple data loader helper for React
22
star
16

apollo-progressive-fragment-matcher

A smart alternative to the introspection fragment matcher.
JavaScript
20
star
17

angular-konami

A Konami Code directive for Angular applications
14
star
18

react-apollo-fragments

True Fragment component for react-apollo
JavaScript
13
star
19

gulp-typeset

Preprocess HTML for better typography
JavaScript
13
star
20

react-apollo-defragment

💿 Automatic query defragmentation based on React trees.
JavaScript
12
star
21

ng-webkit

AngularJS module to help integrate your application with the node-webkit JS library.
JavaScript
12
star
22

react-path-tracker

🐾 Easily track traveled paths on highly dynamic or recursive React trees
JavaScript
12
star
23

harvest-cli

Unofficial Harvest CLI focused on time-tracking entries
JavaScript
11
star
24

next-export-api

Next.js API Routes adaptor for a Netlify static website
TypeScript
10
star
25

procsy

A proxy building helper with subdomain support
JavaScript
8
star
26

console-suppress

Augments console methods with message suppressing capabilities. Very useful during testing.
JavaScript
8
star
27

git-aliases-semantic-commits

Git semantic commit local aliases installer
JavaScript
7
star
28

next-hot-loader

React Hot Loader meets Next.js once again
JavaScript
6
star
29

token-parser

A tokenized string parser for JavaScript
JavaScript
6
star
30

graphql-voyager-online

GraphQL Voyager Online
JavaScript
5
star
31

apollo-link-combine-includes

Apollo Link that performs merging of similar operation requests
JavaScript
4
star
32

angular-slug

An AngularJS wrapper arround the slug library.
4
star
33

sails-hooks-seeds

A simple database seeding hook for the Sails.js framework.
JavaScript
3
star
34

secrethub-manager

🔒 Unofficial SecretHub opinionated manager for simple projects
JavaScript
2
star
35

redux-sample

An extremely simplified version of redux for demonstrations.
JavaScript
2
star
36

miro-next-plugin

Next.js based boilerplate for Miro web plugins
TypeScript
2
star
37

ng-drupal

Drupal related module set for AngularJS applications.
JavaScript
2
star
38

handlebars-css-modules-sample

Demo project to showcase how Handlebars could work with CSS Modules
JavaScript
2
star
39

marcos-rd

JavaScript
1
star
40

git-shared-aliases

Git aliases made available across your team
JavaScript
1
star
41

sails-tracker

JavaScript
1
star
42

node-lib-boilerplate

A boilerplate for node-focused open-source libraries.
JavaScript
1
star
43

next-ie11-syntax-error

JavaScript
1
star