Registry / testing / graphql-resolvers

graphql-resolvers

JSON →
library0.4.2jsnpmunverified

GraphQL Resolvers is a lightweight functional composition library for GraphQL resolvers (v0.4.2, last released 2019, no active maintenance). It provides utilities like combineResolvers, pipeResolvers, allResolvers, and skipResolvers to combine resolver functions in sequence, supporting access control and reusable middleware patterns. Unlike OOP alternatives like apollo-resolvers, it follows a pure functional paradigm similar to recompose but for GraphQL. The library has minimal dependencies and is designed to work with any GraphQL server. However, it is essentially unmaintained since 2019 and may lack updates for current GraphQL ecosystem changes.

npm install graphql-resolvers
INSTALL
IMPORT
SIG · GRAPHQL-RESOLVERS
G
graphql-resolvers
testingjavascriptv0.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

combineResolvers
import { combineResolvers } from 'graphql-resolvers';
const combineResolvers = require('graphql-resolvers').combineResolvers;
ESM and CJS both work in supported environments; avoid default import - there is no default export.
pipeResolvers
import { pipeResolvers } from 'graphql-resolvers';
import pipeResolvers from 'graphql-resolvers';
pipeResolvers is a named export; never default import.
allResolvers
import { allResolvers } from 'graphql-resolvers';
const all = require('graphql-resolvers').all;
The exported name is exactly 'allResolvers', not 'all'.
skipResolvers
import { skipResolvers } from 'graphql-resolvers';

Shows how to compose two resolvers using combineResolvers: first checks authentication, then resolves data.

import { combineResolvers } from 'graphql-resolvers'; const isAuthenticated = (parent, args, { user }) => { if (!user) throw new Error('Not authenticated'); return user; }; const resolveSomething = (parent, args, { db }) => { return db.findSomething(); }; const resolver = combineResolvers( isAuthenticated, resolveSomething ); export default resolver;
Debug
Known issues
breakingThe package has no default export; only named exports are available.
fix
Use named imports like import { combineResolvers } from 'graphql-resolvers';
affects: >=0.0.0
gotchacombineResolvers chains resolvers sequentially but does not pass the return value of one resolver to the next as parent; each receives the original parent.
fix
Use pipeResolvers if you need to pass transformed parent values between resolvers.
affects: >=0.0.0
deprecatedThe library is no longer actively maintained; author has not released updates since 2019.
fix
Consider migrating to graphql-middleware or graphql-resolver-wrapper for long-term support.
affects: >=0.4.0
gotchaallResolvers only works correctly if each resolver returns a value that can be awaited (Promise or scalar); it does not short-circuit on falsy.
fix
Use allResolvers only when you expect all resolvers to pass; otherwise use combineResolvers with error throwing.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: graphql_resolvers_1.default is not a function
Assuming default export exists.
fix
Use named import: import { combineResolvers } from 'graphql-resolvers';
Cannot read property 'combineResolvers' of undefined
Using require('graphql-resolvers').combineResolvers incorrectly in some bundler setups that only support ESM.
fix
Use import { combineResolvers } from 'graphql-resolvers'; or require('graphql-resolvers').combineResolvers (CommonJS compatible).
Error: skip is not a function
Trying to use skipResolvers as 'skip' or 'skipResolver'.
fix
Import with correct name: import { skipResolvers } from 'graphql-resolvers';
Upgrade
Version history
0.4.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
graphql-resolvers — npm install graphql-resolvers · libregistry