Plugin for graphql-compose that adds a Relay Cursor Connections Specification resolver to ObjectTypeComposer. Current version 8.2.1 supports graphql-compose ^7.15.0 || ^8.0.0 || ^9.0.0. Provides standard connection arguments (first, last, before, after) plus filter and sort arguments with compound sorting and cursor-based pagination. Ships TypeScript definitions. Release cadence is low (last release 2021). Differentiators: automatic cursor generation from unique index fields, flexible before/after query builders for any ORM/DB driver.
npm install graphql-compose-connectionNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to add a Relay-compliant connection resolver to UserTC with custom sort and cursor queries.
Ensure your resolvers return the correct types: findManyResolver returns Promise<Object[]> and countResolver returns Promise<number>.
Modify rawQuery properties directly (e.g., rawQuery._id = ...) instead of assigning a new object.
Provide at least one field from a unique index to ensure cursor uniqueness.
Ensure only one version of graphql-compose is installed, matching the peer dependency range (^7.15.0 || ^8.0.0 || ^9.0.0).
Use destructured import: import { prepareConnectionResolver } from 'graphql-compose-connection'Install peer dependency: npm install graphql-compose
Ensure findManyResolver returns Promise<Object[]> (e.g., using a model's find method).